Instead of checking whether mobj->spawnpoint->extrainfo is in the correct range every tic, have a lua error for trying to set it outside (since there'll no doubt be other consequences to being outside the range too)
This commit is contained in:
parent
f0fd9f7656
commit
8fa0641e99
|
@ -804,7 +804,12 @@ static int mapthing_set(lua_State *L)
|
||||||
else if(fastcmp(field,"z"))
|
else if(fastcmp(field,"z"))
|
||||||
mt->z = (INT16)luaL_checkinteger(L, 3);
|
mt->z = (INT16)luaL_checkinteger(L, 3);
|
||||||
else if(fastcmp(field,"extrainfo"))
|
else if(fastcmp(field,"extrainfo"))
|
||||||
mt->extrainfo = (UINT8)luaL_checkinteger(L, 3);
|
{
|
||||||
|
INT32 extrainfo = luaL_checkinteger(L, 3);
|
||||||
|
if (extrainfo & ~15)
|
||||||
|
return luaL_error(L, "mapthing_t extrainfo set %d out of range (%d - %d)", extrainfo, 0, 15);
|
||||||
|
mt->extrainfo = (UINT8)extrainfo;
|
||||||
|
}
|
||||||
else if(fastcmp(field,"mobj"))
|
else if(fastcmp(field,"mobj"))
|
||||||
mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
mt->mobj = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
||||||
else
|
else
|
||||||
|
|
|
@ -7011,7 +7011,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
if (mobj->flags & MF_NOTHINK)
|
if (mobj->flags & MF_NOTHINK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((mobj->flags & MF_BOSS) && mobj->spawnpoint && !(mobj->spawnpoint->extrainfo & ~15) && (bossdisabled & (1<<mobj->spawnpoint->extrainfo)))
|
if ((mobj->flags & MF_BOSS) && mobj->spawnpoint && (bossdisabled & (1<<mobj->spawnpoint->extrainfo)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Remove dead target/tracer.
|
// Remove dead target/tracer.
|
||||||
|
|
Loading…
Reference in a new issue