Skip to content

Commit f30dcdb

Browse files
committedMay 30, 2021
Fix procession ordering issue in content_cao
1 parent 2c53f03 commit f30dcdb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed
 

‎src/client/content_cao.cpp

+10-12
Original file line numberDiff line numberDiff line change
@@ -346,18 +346,6 @@ void GenericCAO::initialize(const std::string &data)
346346
infostream<<"GenericCAO: Got init data"<<std::endl;
347347
processInitData(data);
348348

349-
if (m_is_player) {
350-
// Check if it's the current player
351-
LocalPlayer *player = m_env->getLocalPlayer();
352-
if (player && strcmp(player->getName(), m_name.c_str()) == 0) {
353-
m_is_local_player = true;
354-
m_is_visible = false;
355-
player->setCAO(this);
356-
357-
m_prop.show_on_minimap = false;
358-
}
359-
}
360-
361349
m_enable_shaders = g_settings->getBool("enable_shaders");
362350
}
363351

@@ -380,6 +368,16 @@ void GenericCAO::processInitData(const std::string &data)
380368
m_rotation = readV3F32(is);
381369
m_hp = readU16(is);
382370

371+
if (m_is_player) {
372+
// Check if it's the current player
373+
LocalPlayer *player = m_env->getLocalPlayer();
374+
if (player && strcmp(player->getName(), m_name.c_str()) == 0) {
375+
m_is_local_player = true;
376+
m_is_visible = false;
377+
player->setCAO(this);
378+
}
379+
}
380+
383381
const u8 num_messages = readU8(is);
384382

385383
for (int i = 0; i < num_messages; i++) {

0 commit comments

Comments
 (0)
Please sign in to comment.