diff options
author | sfan5 <sfan5@live.de> | 2020-02-11 13:23:03 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-02-11 19:21:12 +0100 |
commit | 91eef646a59575bd9ae792e257bb6ad12fafc0b1 (patch) | |
tree | f7346e6020225e143b8da6c25d3ffe0572674f4c /src/content_sao.cpp | |
parent | b14aa1c84714a4800d214768ff7868a7bb76f7ae (diff) | |
download | minetest-91eef646a59575bd9ae792e257bb6ad12fafc0b1.tar.gz minetest-91eef646a59575bd9ae792e257bb6ad12fafc0b1.tar.bz2 minetest-91eef646a59575bd9ae792e257bb6ad12fafc0b1.zip |
Script API: Check that SAOs are still usable before attempting to use them
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r-- | src/content_sao.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 43c784b42..5119223a7 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -864,7 +864,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, session_t p m_peer_id(peer_id_), m_is_singleplayer(is_singleplayer) { - assert(m_peer_id != 0); // pre-condition + SANITY_CHECK(m_peer_id != PEER_ID_INEXISTENT); m_prop.hp_max = PLAYER_MAX_HP_DEFAULT; m_prop.breath_max = PLAYER_MAX_BREATH_DEFAULT; @@ -1393,7 +1393,7 @@ bool PlayerSAO::setWieldedItem(const ItemStack &item) void PlayerSAO::disconnected() { - m_peer_id = 0; + m_peer_id = PEER_ID_INEXISTENT; m_pending_removal = true; } |