Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add missing sao->isGone() checks
- Loading branch information
Showing
with
4 additions
and
1 deletion.
-
+2
−1
src/collision.cpp
-
+2
−0
src/serverenvironment.cpp
|
@@ -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; |
|
|
|
@@ -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; |
|
|
Optimally that would be included in
getObjectsInsideRadius
directly.