diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 00e17f328b32e2b4d972b00bc3124b71d1abe5ee..a8e03d6701e1358fc25dfb95dcd5aae96388afe2 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -659,10 +659,7 @@ void GenericCAO::initialize(const std::string &data)
 		if (player && strcmp(player->getName(), m_name.c_str()) == 0) {
 			m_is_local_player = true;
 			m_is_visible = false;
-			LocalPlayer* localplayer = player;
-
-			assert( localplayer != NULL );
-			localplayer->setCAO(this);
+			player->setCAO(this);
 		}
 		m_env->addPlayerName(m_name.c_str());
 	}