diff options
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index a53768149..00e17f328 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -653,10 +653,10 @@ void GenericCAO::initialize(const std::string &data) pos_translator.init(m_position); updateNodePos(); - if(m_is_player) - { - LocalPlayer *player = m_env->getPlayer(m_name.c_str()); - if (player && player->isLocal()) { + if (m_is_player) { + // Check if it's the current player + LocalPlayer *player = m_env->getLocalPlayer(); + if (player && strcmp(player->getName(), m_name.c_str()) == 0) { m_is_local_player = true; m_is_visible = false; LocalPlayer* localplayer = player; |