aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-05-18 23:23:25 +0200
committersfan5 <sfan5@live.de>2020-05-18 23:23:25 +0200
commit0fc51db7722f9aa1e0aa2dacade6041c932b0731 (patch)
tree42a82af6d2914532eb42160c69c13aabd750cb91
parent11723cffe011e99c1092388958fb1a047ab1c09c (diff)
downloadminetest-0fc51db7722f9aa1e0aa2dacade6041c932b0731.tar.gz
minetest-0fc51db7722f9aa1e0aa2dacade6041c932b0731.tar.bz2
minetest-0fc51db7722f9aa1e0aa2dacade6041c932b0731.zip
Add missing sao->isGone() checks
fixes #9883
-rw-r--r--src/collision.cpp3
-rw-r--r--src/serverenvironment.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/collision.cpp b/src/collision.cpp
index 06ef820c5..d85a56884 100644
--- a/src/collision.cpp
+++ b/src/collision.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;
diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp
index 6bf7399cf..d485c32e8 100644
--- a/src/serverenvironment.cpp
+++ b/src/serverenvironment.cpp
@@ -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;