summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-07 15:17:59 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-07 15:17:59 +0100
commit43ed87ab46a7fdf99ef02747b6d7f2bd15975271 (patch)
tree4628c6fc8c6d7d975427b682d123170f9936aa8e
parent7fdf648555febd21456d6e3baf4b06f131d9ec04 (diff)
downloadtermgl-43ed87ab46a7fdf99ef02747b6d7f2bd15975271.tar.gz
Added sanity cehck in cObject::moveObject() to check if hit object exists
-rw-r--r--src/cObjectHandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cObjectHandler.cpp b/src/cObjectHandler.cpp
index da0dcc9..02dd115 100644
--- a/src/cObjectHandler.cpp
+++ b/src/cObjectHandler.cpp
@@ -50,7 +50,7 @@ int cObjectHandler::moveObject(unsigned int _object, sPos _pos, int _mode)
{
for(unsigned int i = 0; i < coll.idc; i++)
{
- if(coll.idv[i] != _object)
+ if(coll.idv[i] != _object && objects[coll.idv[i]])
abort += objects[_object]->onCollisionActive(_pos, objects[coll.idv[i]]->onCollisionPassive(_pos));
}
}