aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authoryou <ovvv@web.de>2017-08-27 18:38:50 +0200
committerSmallJoker <SmallJoker@users.noreply.github.com>2017-08-27 18:38:50 +0200
commite09c7fceaa93ad3d7d85f657df0663f6efc70281 (patch)
tree46e3f3a1f27e88074c75c6916e431f001218d943 /src/script
parentde331b18e921be1489b8cb151c628dadf3cc5ce7 (diff)
downloadminetest-e09c7fceaa93ad3d7d85f657df0663f6efc70281.tar.gz
minetest-e09c7fceaa93ad3d7d85f657df0663f6efc70281.tar.bz2
minetest-e09c7fceaa93ad3d7d85f657df0663f6efc70281.zip
core.get_objects_inside_radius: Omit removed objects (#6318)
Fixes #6294
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_env.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index 07d33a4eb..be92365ac 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -642,9 +642,11 @@ int ModApiEnvMod::l_get_objects_inside_radius(lua_State *L)
std::vector<u16>::const_iterator iter = ids.begin();
for(u32 i = 0; iter != ids.end(); ++iter) {
ServerActiveObject *obj = env->getActiveObject(*iter);
- // Insert object reference into table
- script->objectrefGetOrCreate(L, obj);
- lua_rawseti(L, -2, ++i);
+ if (!obj->m_removed) {
+ // Insert object reference into table
+ script->objectrefGetOrCreate(L, obj);
+ lua_rawseti(L, -2, ++i);
+ }
}
return 1;
}