forked from Mirrorlandia_minetest/minetest
GenericCAO: Fix light position for non-players, remove deprecated initialisation code (#6281)
This commit is contained in:
parent
de4c2e4250
commit
4a1265ceb5
@ -320,13 +320,6 @@ void GenericCAO::processInitData(const std::string &data)
|
|||||||
m_yaw = readF1000(is);
|
m_yaw = readF1000(is);
|
||||||
m_hp = readS16(is);
|
m_hp = readS16(is);
|
||||||
num_messages = readU8(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 {
|
} else {
|
||||||
errorstream<<"GenericCAO: Unsupported init data version"
|
errorstream<<"GenericCAO: Unsupported init data version"
|
||||||
<<std::endl;
|
<<std::endl;
|
||||||
@ -689,7 +682,10 @@ void GenericCAO::updateLightNoCheck(u8 light_at_pos)
|
|||||||
|
|
||||||
v3s16 GenericCAO::getLightPosition()
|
v3s16 GenericCAO::getLightPosition()
|
||||||
{
|
{
|
||||||
|
if (m_is_player)
|
||||||
return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);
|
return floatToInt(m_position + v3f(0, 0.5 * BS, 0), BS);
|
||||||
|
|
||||||
|
return floatToInt(m_position, BS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericCAO::updateNodePos()
|
void GenericCAO::updateNodePos()
|
||||||
|
Loading…
Reference in New Issue
Block a user