mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Reset tmthing after P_CheckSector calls from Lua
tmthing must not be set outside of P_MapStart and P_MapEnd or the game will fail a sanity check which ensures that mobj references are not persistent across frames and crash.
This commit is contained in:
parent
c91cd3860b
commit
f783df718c
1 changed files with 8 additions and 0 deletions
|
@ -396,6 +396,7 @@ static int sector_set(lua_State *L)
|
|||
return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]);
|
||||
case sector_floorheight: { // floorheight
|
||||
boolean flag;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
fixed_t lastpos = sector->floorheight;
|
||||
sector->floorheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
@ -404,10 +405,12 @@ static int sector_set(lua_State *L)
|
|||
sector->floorheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
case sector_ceilingheight: { // ceilingheight
|
||||
boolean flag;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
fixed_t lastpos = sector->ceilingheight;
|
||||
sector->ceilingheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
@ -416,6 +419,7 @@ static int sector_set(lua_State *L)
|
|||
sector->ceilingheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
case sector_floorpic:
|
||||
|
@ -1071,6 +1075,7 @@ static int ffloor_set(lua_State *L)
|
|||
case ffloor_topheight: { // topheight
|
||||
boolean flag;
|
||||
fixed_t lastpos = *ffloor->topheight;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
sector_t *sector = §ors[ffloor->secnum];
|
||||
sector->ceilingheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
@ -1079,6 +1084,7 @@ static int ffloor_set(lua_State *L)
|
|||
*ffloor->topheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
case ffloor_toppic:
|
||||
|
@ -1090,6 +1096,7 @@ static int ffloor_set(lua_State *L)
|
|||
case ffloor_bottomheight: { // bottomheight
|
||||
boolean flag;
|
||||
fixed_t lastpos = *ffloor->bottomheight;
|
||||
mobj_t *ptmthing = tmthing;
|
||||
sector_t *sector = §ors[ffloor->secnum];
|
||||
sector->floorheight = luaL_checkfixed(L, 3);
|
||||
flag = P_CheckSector(sector, true);
|
||||
|
@ -1098,6 +1105,7 @@ static int ffloor_set(lua_State *L)
|
|||
*ffloor->bottomheight = lastpos;
|
||||
P_CheckSector(sector, true);
|
||||
}
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
case ffloor_bottompic:
|
||||
|
|
Loading…
Reference in a new issue