summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2018-05-14 21:03:48 +0200
committerSmallJoker <mk939@ymail.com>2018-05-14 21:19:52 +0200
commita1598e1b83e28503745165d5749cd21b77e97818 (patch)
tree3f5388c0f8d18fb2d35c345f53014e7cd234ecb8 /src/content_sao.cpp
parenta01a9ca24cf74434d3d9d558d50e24d7de514e03 (diff)
downloadminetest-a1598e1b83e28503745165d5749cd21b77e97818.tar.gz
minetest-a1598e1b83e28503745165d5749cd21b77e97818.tar.bz2
minetest-a1598e1b83e28503745165d5749cd21b77e97818.zip
Fix segfault in player migration and crash in log_deprecated
Makes log_deprecated work when triggered from no function
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 1c049c727..6ed78beb0 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -1166,8 +1166,12 @@ void PlayerSAO::setBasePosition(const v3f &position)
// This needs to be ran for attachments too
ServerActiveObject::setBasePosition(position);
- m_env->updateActiveObject(this);
- m_position_not_sent = true;
+
+ // Updating is not wanted/required for player migration
+ if (m_env) {
+ m_env->updateActiveObject(this);
+ m_position_not_sent = true;
+ }
}
void PlayerSAO::setPos(const v3f &pos)