1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

core.get_objects_inside_radius: Omit removed objects (#6318)

Fixes #6294
This commit is contained in:
you 2017-08-27 18:38:50 +02:00 committed by SmallJoker
parent de331b18e9
commit e09c7fceaa
2 changed files with 6 additions and 4 deletions

View file

@ -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;
}