Add missing sao->isGone() checks
authorsfan5 <sfan5@live.de>
Mon, 18 May 2020 21:23:25 +0000 (23:23 +0200)
committersfan5 <sfan5@live.de>
Mon, 18 May 2020 21:23:25 +0000 (23:23 +0200)
fixes #9883

src/collision.cpp
src/serverenvironment.cpp

index 06ef820c5095b3cf8d5118ace2749c23dc34e317..d85a5688435a516b879c35a1b7811f7cdb2ce423 100644 (file)
@@ -397,7 +397,8 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
                                // we directly use the callback to populate the result to prevent
                                // a useless result loop here
                                auto include_obj_cb = [self, &objects] (ServerActiveObject *obj) {
-                                       if (!self || (self != obj && self != obj->getParent())) {
+                                       if (!obj->isGone() &&
+                                               (!self || (self != obj && self != obj->getParent()))) {
                                                objects.push_back((ActiveObject *)obj);
                                        }
                                        return false;
index 6bf7399cff43c8625e745c3947e25686c1fd41a4..d485c32e8111323548bedf15786d5bacfe0cd0e9 100644 (file)
@@ -1623,6 +1623,8 @@ void ServerEnvironment::getSelectedActiveObjects(
        const v3f line_vector = shootline_on_map.getVector();
 
        for (auto obj : objs) {
+               if (obj->isGone())
+                       continue;
                aabb3f selection_box;
                if (!obj->getSelectionBox(&selection_box))
                        continue;