Skip to content

Commit

Permalink
Add missing sao->isGone() checks
Browse files Browse the repository at this point in the history
fixes #9883
  • Loading branch information
sfan5 committed May 18, 2020
1 parent 11723cf commit 0fc51db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/collision.cpp
Expand Up @@ -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() &&

This comment has been minimized.

Copy link
@SmallJoker

SmallJoker May 19, 2020

Member

Optimally that would be included in getObjectsInsideRadius directly.

(!self || (self != obj && self != obj->getParent()))) {
objects.push_back((ActiveObject *)obj);
}
return false;
Expand Down
2 changes: 2 additions & 0 deletions src/serverenvironment.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 0fc51db

Please sign in to comment.