Skip to content

Commit 4a1265c

Browse files
SmallJokernerzhul
authored andcommittedAug 19, 2017
GenericCAO: Fix light position for non-players, remove deprecated initialisation code (#6281)
1 parent de4c2e4 commit 4a1265c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed
 

‎src/content_cao.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,6 @@ void GenericCAO::processInitData(const std::string &data)
320320
m_yaw = readF1000(is);
321321
m_hp = readS16(is);
322322
num_messages = readU8(is);
323-
} else if (version == 0) { // In PROTOCOL_VERSION 13
324-
m_name = deSerializeString(is);
325-
m_is_player = readU8(is);
326-
m_position = readV3F1000(is);
327-
m_yaw = readF1000(is);
328-
m_hp = readS16(is);
329-
num_messages = readU8(is);
330323
} else {
331324
errorstream<<"GenericCAO: Unsupported init data version"
332325
<<std::endl;
@@ -689,7 +682,10 @@ void GenericCAO::updateLightNoCheck(u8 light_at_pos)
689682

690683
v3s16 GenericCAO::getLightPosition()
691684
{
692-
return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);
685+
if (m_is_player)
686+
return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);
Has a conversation. Original line has a conversation.
687+
688+
return floatToInt(m_position, BS);
693689
}
694690

695691
void GenericCAO::updateNodePos()

0 commit comments

Comments
 (0)
Please sign in to comment.