summaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 0a1a92271..8bec67c8c 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -708,11 +708,15 @@ public:
if(player && player->isLocal()){
m_is_local_player = true;
}
+ m_env->addPlayerName(m_name.c_str());
}
}
~GenericCAO()
{
+ if(m_is_player){
+ m_env->removePlayerName(m_name.c_str());
+ }
}
static ClientActiveObject* create(IGameDef *gamedef, ClientEnvironment *env)