src/environment.cpp: Fix NULL pointer dereference

This commit is contained in:
Břetislav Štec 2015-08-01 14:07:12 +02:00
parent 3f63c499e9
commit 057ac2e696
1 changed files with 13 additions and 11 deletions

View File

@ -1826,6 +1826,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
MapBlock *block = m_map->emergeBlock(obj->m_static_block, false);
if (block) {
std::map<u16, StaticObject>::iterator n =
block->m_static_objects.m_active.find(id);
if (n != block->m_static_objects.m_active.end()) {
@ -1843,6 +1844,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
<<PP(obj->m_static_block)<<std::endl;
}
}
}
bool shall_be_written = (!stays_in_same_block || data_changed);