Skip to content
Snippets Groups Projects
Commit e1d15b5e authored by Hanicef's avatar Hanicef
Browse files

Fix segfault when removing mobjs while iterating thinglist

parent 1b2b7658
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment