aboutsummaryrefslogtreecommitdiff
path: root/src/content_cao.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2017-08-19 11:30:09 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-08-19 11:30:09 +0200
commit4a1265ceb5919c53efaa8c50bbb0fe7955aa47aa (patch)
treee1be86e1d63d9408781782998dbd70f37833bc40 /src/content_cao.cpp
parentde4c2e4250d3071a8de7841a1cb3a63af67c63f3 (diff)
downloadminetest-4a1265ceb5919c53efaa8c50bbb0fe7955aa47aa.tar.gz
minetest-4a1265ceb5919c53efaa8c50bbb0fe7955aa47aa.tar.bz2
minetest-4a1265ceb5919c53efaa8c50bbb0fe7955aa47aa.zip
GenericCAO: Fix light position for non-players, remove deprecated initialisation code (#6281)
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r--src/content_cao.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 627da056a..8f6847bc0 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -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;
@@ -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);
+
+ return floatToInt(m_position, BS);
}
void GenericCAO::updateNodePos()