Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GenericCAO: Fix light position for non-players, remove deprecated ini…
…tialisation code (#6281)
  • Loading branch information
SmallJoker authored and nerzhul committed Aug 19, 2017
1 parent de4c2e4 commit 4a1265c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/content_cao.cpp
Expand Up @@ -320,13 +320,6 @@ void GenericCAO::processInitData(const std::string &data)
m_yaw = readF1000(is);
m_hp = readS16(is);
num_messages = readU8(is);
} else if (version == 0) { // In PROTOCOL_VERSION 13
m_name = deSerializeString(is);
m_is_player = readU8(is);
m_position = readV3F1000(is);
m_yaw = readF1000(is);
m_hp = readS16(is);
num_messages = readU8(is);
} else {
errorstream<<"GenericCAO: Unsupported init data version"
<<std::endl;
Expand Down Expand Up @@ -689,7 +682,10 @@ void GenericCAO::updateLightNoCheck(u8 light_at_pos)

v3s16 GenericCAO::getLightPosition()
{
return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);
if (m_is_player)
return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);

This comment has been minimized.

Copy link
@paramat

paramat Aug 19, 2017

Contributor

@SmallJoker 0.0f and 0.5f
But otherwise good.


return floatToInt(m_position, BS);
}

void GenericCAO::updateNodePos()
Expand Down

0 comments on commit 4a1265c

Please sign in to comment.