mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fixed null pointer dereference errors found by cppcheck
This commit is contained in:
parent
789c88509c
commit
ae561d705f
2 changed files with 5 additions and 4 deletions
|
@ -1345,8 +1345,6 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
|
|||
i.atEnd()==false; i++)
|
||||
{
|
||||
ServerActiveObject* obj = i.getNode()->getValue();
|
||||
u16 id = i.getNode()->getKey();
|
||||
v3f objectpos = obj->getBasePosition();
|
||||
|
||||
// This shouldn't happen but check it
|
||||
if(obj == NULL)
|
||||
|
@ -1357,9 +1355,12 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
|
|||
continue;
|
||||
}
|
||||
|
||||
u16 id = i.getNode()->getKey();
|
||||
v3f objectpos = obj->getBasePosition();
|
||||
|
||||
// The block in which the object resides in
|
||||
v3s16 blockpos_o = getNodeBlockPos(floatToInt(objectpos, BS));
|
||||
|
||||
|
||||
// If block is active, don't remove
|
||||
if(m_active_blocks.contains(blockpos_o))
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue