mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
src/environment.cpp: Fix NULL pointer dereference
This commit is contained in:
parent
79e2647556
commit
67997af67f
1 changed files with 13 additions and 11 deletions
|
@ -1826,6 +1826,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
|
||||||
|
|
||||||
MapBlock *block = m_map->emergeBlock(obj->m_static_block, false);
|
MapBlock *block = m_map->emergeBlock(obj->m_static_block, false);
|
||||||
|
|
||||||
|
if (block) {
|
||||||
std::map<u16, StaticObject>::iterator n =
|
std::map<u16, StaticObject>::iterator n =
|
||||||
block->m_static_objects.m_active.find(id);
|
block->m_static_objects.m_active.find(id);
|
||||||
if (n != block->m_static_objects.m_active.end()) {
|
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;
|
<<PP(obj->m_static_block)<<std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool shall_be_written = (!stays_in_same_block || data_changed);
|
bool shall_be_written = (!stays_in_same_block || data_changed);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue