Skip to content
Snippets Groups Projects

Fix segfault when removing mobjs while iterating thinglist

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-segfault-remove-thinglist into next
All threads resolved!
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
+ 2
0
@@ -486,6 +486,8 @@ static int lib_iterateSectorThinglist(lua_State *L)
if (!lua_isnil(L, 1))
{
thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
if (P_MobjWasRemoved(thing))
return luaL_error(L, "current entry in thinglist was removed; avoid calling P_MobjWasRemoved on entries!");
thing = thing->snext;
}
else
Loading