mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Merge branch 'fof-fixes-movingplatexists' into 'master'
Moving platform fix: Player snaps to floor when setting ~FF_EXISTS See merge request STJr/SRB2Internal!188
This commit is contained in:
commit
b7bcc16c98
7 changed files with 172 additions and 12 deletions
|
@ -40,6 +40,8 @@ enum mobj_e {
|
|||
mobj_subsector,
|
||||
mobj_floorz,
|
||||
mobj_ceilingz,
|
||||
mobj_floorrover,
|
||||
mobj_ceilingrover,
|
||||
mobj_radius,
|
||||
mobj_height,
|
||||
mobj_momx,
|
||||
|
@ -100,6 +102,8 @@ static const char *const mobj_opt[] = {
|
|||
"subsector",
|
||||
"floorz",
|
||||
"ceilingz",
|
||||
"floorrover",
|
||||
"ceilingrover",
|
||||
"radius",
|
||||
"height",
|
||||
"momx",
|
||||
|
@ -208,6 +212,12 @@ static int mobj_get(lua_State *L)
|
|||
case mobj_ceilingz:
|
||||
lua_pushfixed(L, mo->ceilingz);
|
||||
break;
|
||||
case mobj_floorrover:
|
||||
LUA_PushUserdata(L, mo->floorrover, META_FFLOOR);
|
||||
break;
|
||||
case mobj_ceilingrover:
|
||||
LUA_PushUserdata(L, mo->ceilingrover, META_FFLOOR);
|
||||
break;
|
||||
case mobj_radius:
|
||||
lua_pushfixed(L, mo->radius);
|
||||
break;
|
||||
|
@ -396,6 +406,8 @@ static int mobj_set(lua_State *L)
|
|||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
|
@ -430,6 +442,10 @@ static int mobj_set(lua_State *L)
|
|||
return NOSETPOS;
|
||||
case mobj_ceilingz:
|
||||
return NOSETPOS;
|
||||
case mobj_floorrover:
|
||||
return NOSET;
|
||||
case mobj_ceilingrover:
|
||||
return NOSET;
|
||||
case mobj_radius:
|
||||
{
|
||||
mobj_t *ptmthing = tmthing;
|
||||
|
@ -439,6 +455,8 @@ static int mobj_set(lua_State *L)
|
|||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
|
@ -451,6 +469,8 @@ static int mobj_set(lua_State *L)
|
|||
P_CheckPosition(mo, mo->x, mo->y);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
P_SetTarget(&tmthing, ptmthing);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -326,6 +326,7 @@ void P_InternalFlickyHop(mobj_t *actor, fixed_t momz, fixed_t momh, angle_t angl
|
|||
extern boolean floatok;
|
||||
extern fixed_t tmfloorz;
|
||||
extern fixed_t tmceilingz;
|
||||
extern ffloor_t *tmfloorrover, *tmceilingrover;
|
||||
extern mobj_t *tmfloorthing, *tmhitthing, *tmthing;
|
||||
extern camera_t *mapcampointer;
|
||||
extern fixed_t tmx;
|
||||
|
|
60
src/p_map.c
60
src/p_map.c
|
@ -52,6 +52,7 @@ fixed_t tmfloorz, tmceilingz;
|
|||
static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights
|
||||
mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector
|
||||
mobj_t *tmhitthing; // the solid thing you bumped into (for collisions)
|
||||
ffloor_t *tmfloorrover, *tmceilingrover;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *tmfloorslope, *tmceilingslope;
|
||||
#endif
|
||||
|
@ -101,6 +102,8 @@ boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z)
|
|||
|
||||
thing->floorz = tmfloorz;
|
||||
thing->ceilingz = tmceilingz;
|
||||
thing->floorrover = tmfloorrover;
|
||||
thing->ceilingrover = tmceilingrover;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1417,6 +1420,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (thing->z + thing->height > tmfloorz)
|
||||
{
|
||||
tmfloorz = thing->z + thing->height;
|
||||
tmfloorrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
|
@ -1437,6 +1441,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return false;
|
||||
|
||||
tmfloorz = tmceilingz = topz; // block while in air
|
||||
tmceilingrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
|
@ -1445,6 +1450,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
||||
{
|
||||
tmceilingz = topz;
|
||||
tmceilingrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
|
@ -1461,6 +1467,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (thing->z < tmceilingz)
|
||||
{
|
||||
tmceilingz = thing->z;
|
||||
tmceilingrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = NULL;
|
||||
#endif
|
||||
|
@ -1481,6 +1488,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return false;
|
||||
|
||||
tmfloorz = tmceilingz = topz; // block while in air
|
||||
tmfloorrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
|
@ -1489,6 +1497,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
||||
{
|
||||
tmfloorz = topz;
|
||||
tmfloorrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
|
@ -1640,6 +1649,7 @@ static boolean PIT_CheckLine(line_t *ld)
|
|||
{
|
||||
tmceilingz = opentop;
|
||||
ceilingline = ld;
|
||||
tmceilingrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = opentopslope;
|
||||
#endif
|
||||
|
@ -1648,6 +1658,7 @@ static boolean PIT_CheckLine(line_t *ld)
|
|||
if (openbottom > tmfloorz)
|
||||
{
|
||||
tmfloorz = openbottom;
|
||||
tmfloorrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = openbottomslope;
|
||||
#endif
|
||||
|
@ -1729,6 +1740,8 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
// will adjust them.
|
||||
tmfloorz = tmdropoffz = P_GetFloorZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->floorheight;
|
||||
tmceilingz = P_GetCeilingZ(thing, newsubsec->sector, x, y, NULL); //newsubsec->sector->ceilingheight;
|
||||
tmfloorrover = NULL;
|
||||
tmceilingrover = NULL;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = newsubsec->sector->f_slope;
|
||||
tmceilingslope = newsubsec->sector->c_slope;
|
||||
|
@ -1772,6 +1785,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
{
|
||||
if (tmfloorz < topheight - sinklevel) {
|
||||
tmfloorz = topheight - sinklevel;
|
||||
tmfloorrover = rover;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = *rover->t_slope;
|
||||
#endif
|
||||
|
@ -1781,6 +1795,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
{
|
||||
if (tmceilingz > bottomheight + sinklevel) {
|
||||
tmceilingz = bottomheight + sinklevel;
|
||||
tmceilingrover = rover;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = *rover->b_slope;
|
||||
#endif
|
||||
|
@ -1805,6 +1820,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
{
|
||||
if (tmfloorz < thing->z) {
|
||||
tmfloorz = thing->z;
|
||||
tmfloorrover = rover;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = NULL;
|
||||
#endif
|
||||
|
@ -1823,6 +1839,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
&& !(rover->flags & FF_REVERSEPLATFORM))
|
||||
{
|
||||
tmfloorz = tmdropoffz = topheight;
|
||||
tmfloorrover = rover;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = *rover->t_slope;
|
||||
#endif
|
||||
|
@ -1832,6 +1849,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
&& !(thing->type == MT_SKIM && (rover->flags & FF_SWIMMABLE)))
|
||||
{
|
||||
tmceilingz = tmdrpoffceilz = bottomheight;
|
||||
tmceilingrover = rover;
|
||||
#ifdef ESLOPE
|
||||
tmceilingslope = *rover->b_slope;
|
||||
#endif
|
||||
|
@ -2328,6 +2346,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
|||
mobj_t *oldthing = tmthing;
|
||||
line_t *oldceilline = ceilingline;
|
||||
line_t *oldblockline = blockingline;
|
||||
ffloor_t *oldflrrover = tmfloorrover;
|
||||
ffloor_t *oldceilrover = tmceilingrover;
|
||||
#ifdef ESLOPE
|
||||
pslope_t *oldfslope = tmfloorslope;
|
||||
pslope_t *oldcslope = tmceilingslope;
|
||||
|
@ -2344,6 +2364,8 @@ boolean PIT_PushableMoved(mobj_t *thing)
|
|||
P_SetTarget(&tmthing, oldthing);
|
||||
ceilingline = oldceilline;
|
||||
blockingline = oldblockline;
|
||||
tmfloorrover = oldflrrover;
|
||||
tmceilingrover = oldceilrover;
|
||||
#ifdef ESLOPE
|
||||
tmfloorslope = oldfslope;
|
||||
tmceilingslope = oldcslope;
|
||||
|
@ -2465,6 +2487,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
if (thingtop == thing->ceilingz && tmceilingz > thingtop && tmceilingz - thingtop <= maxstep)
|
||||
{
|
||||
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
|
||||
thing->ceilingrover = tmceilingrover;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
|
@ -2472,6 +2495,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
else if (tmceilingslope && tmceilingz < thingtop && thingtop - tmceilingz <= maxstep)
|
||||
{
|
||||
thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height;
|
||||
thing->ceilingrover = tmceilingrover;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#endif
|
||||
|
@ -2479,6 +2503,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->z - tmfloorz <= maxstep)
|
||||
{
|
||||
thing->z = thing->floorz = tmfloorz;
|
||||
thing->floorrover = tmfloorrover;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#ifdef ESLOPE
|
||||
|
@ -2486,6 +2511,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
else if (tmfloorslope && tmfloorz > thing->z && tmfloorz - thing->z <= maxstep)
|
||||
{
|
||||
thing->z = thing->floorz = tmfloorz;
|
||||
thing->floorrover = tmfloorrover;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
#endif
|
||||
|
@ -2557,6 +2583,8 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
|
||||
thing->floorz = tmfloorz;
|
||||
thing->ceilingz = tmceilingz;
|
||||
thing->floorrover = tmfloorrover;
|
||||
thing->ceilingrover = tmceilingrover;
|
||||
|
||||
#ifdef ESLOPE
|
||||
if (!(thing->flags & MF_NOCLIPHEIGHT))
|
||||
|
@ -2637,6 +2665,8 @@ boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
|
||||
thing->floorz = tmfloorz;
|
||||
thing->ceilingz = tmceilingz;
|
||||
thing->floorrover = tmfloorrover;
|
||||
thing->ceilingrover = tmceilingrover;
|
||||
thing->x = x;
|
||||
thing->y = y;
|
||||
|
||||
|
@ -2663,7 +2693,10 @@ static boolean P_ThingHeightClip(mobj_t *thing)
|
|||
{
|
||||
boolean floormoved;
|
||||
fixed_t oldfloorz = thing->floorz;
|
||||
ffloor_t *oldfloorrover = thing->floorrover;
|
||||
ffloor_t *oldceilingrover = thing->ceilingrover;
|
||||
boolean onfloor = P_IsObjectOnGround(thing);//(thing->z <= thing->floorz);
|
||||
ffloor_t *rover = NULL;
|
||||
|
||||
if (thing->flags & MF_NOCLIPHEIGHT)
|
||||
return true;
|
||||
|
@ -2678,6 +2711,8 @@ static boolean P_ThingHeightClip(mobj_t *thing)
|
|||
|
||||
thing->floorz = tmfloorz;
|
||||
thing->ceilingz = tmceilingz;
|
||||
thing->floorrover = tmfloorrover;
|
||||
thing->ceilingrover = tmceilingrover;
|
||||
|
||||
// Ugly hack?!?! As long as just ceilingz is the lowest,
|
||||
// you'll still get crushed, right?
|
||||
|
@ -2686,16 +2721,23 @@ static boolean P_ThingHeightClip(mobj_t *thing)
|
|||
|
||||
if (onfloor && !(thing->flags & MF_NOGRAVITY) && floormoved)
|
||||
{
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->pmomz = thing->ceilingz - (thing->z + thing->height);
|
||||
else
|
||||
thing->pmomz = thing->floorz - thing->z;
|
||||
thing->eflags |= MFE_APPLYPMOMZ;
|
||||
rover = (thing->eflags & MFE_VERTICALFLIP) ? oldceilingrover : oldfloorrover;
|
||||
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z = thing->ceilingz - thing->height;
|
||||
else
|
||||
thing->z = thing->floorz;
|
||||
// Match the Thing's old floorz to an FOF and check for FF_EXISTS
|
||||
// If ~FF_EXISTS, don't set mobj Z.
|
||||
if (!rover || ((rover->flags & FF_EXISTS) && (rover->flags & FF_SOLID)))
|
||||
{
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->pmomz = thing->ceilingz - (thing->z + thing->height);
|
||||
else
|
||||
thing->pmomz = thing->floorz - thing->z;
|
||||
thing->eflags |= MFE_APPLYPMOMZ;
|
||||
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z = thing->ceilingz - thing->height;
|
||||
else
|
||||
thing->z = thing->floorz;
|
||||
}
|
||||
}
|
||||
else if (!tmfloorthing)
|
||||
{
|
||||
|
|
10
src/p_mobj.c
10
src/p_mobj.c
|
@ -8027,6 +8027,8 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
return;
|
||||
mobj->floorz = tmfloorz;
|
||||
mobj->ceilingz = tmceilingz;
|
||||
mobj->floorrover = tmfloorrover;
|
||||
mobj->ceilingrover = tmceilingrover;
|
||||
|
||||
if ((mobj->eflags & MFE_UNDERWATER) && mobj->health > 0)
|
||||
{
|
||||
|
@ -8545,6 +8547,8 @@ void P_SceneryThinker(mobj_t *mobj)
|
|||
return;
|
||||
mobj->floorz = tmfloorz;
|
||||
mobj->ceilingz = tmceilingz;
|
||||
mobj->floorrover = tmfloorrover;
|
||||
mobj->ceilingrover = tmceilingrover;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8627,6 +8631,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
#endif
|
||||
mobj->subsector->sector->ceilingheight;
|
||||
|
||||
mobj->floorrover = NULL;
|
||||
mobj->ceilingrover = NULL;
|
||||
|
||||
// Tells MobjCheckWater that the water height was not set.
|
||||
mobj->watertop = INT32_MAX;
|
||||
|
||||
|
@ -8890,6 +8897,9 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
|
|||
#endif
|
||||
mobj->subsector->sector->ceilingheight;
|
||||
|
||||
mobj->floorrover = NULL;
|
||||
mobj->ceilingrover = NULL;
|
||||
|
||||
mobj->z = z;
|
||||
mobj->momz = mobjinfo[type].speed;
|
||||
|
||||
|
|
|
@ -282,6 +282,8 @@ typedef struct mobj_s
|
|||
// The closest interval over all contacted sectors (or things).
|
||||
fixed_t floorz; // Nearest floor below.
|
||||
fixed_t ceilingz; // Nearest ceiling above.
|
||||
struct ffloor_s *floorrover; // FOF referred by floorz
|
||||
struct ffloor_s *ceilingrover; // FOF referred by ceilingz
|
||||
|
||||
// For movement checking.
|
||||
fixed_t radius;
|
||||
|
@ -398,6 +400,8 @@ typedef struct precipmobj_s
|
|||
// The closest interval over all contacted sectors (or things).
|
||||
fixed_t floorz; // Nearest floor below.
|
||||
fixed_t ceilingz; // Nearest ceiling above.
|
||||
struct ffloor_s *floorrover; // FOF referred by floorz
|
||||
struct ffloor_s *ceilingrover; // FOF referred by ceilingz
|
||||
|
||||
// For movement checking.
|
||||
fixed_t radius; // Fixed at 2*FRACUNIT
|
||||
|
|
|
@ -985,6 +985,8 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
|
|||
P_CheckPosition(mo, mo->x + momx, mo->y + momy);
|
||||
mo->floorz = tmfloorz;
|
||||
mo->ceilingz = tmceilingz;
|
||||
mo->floorrover = tmfloorrover;
|
||||
mo->ceilingrover = tmceilingrover;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1250,11 +1250,13 @@ typedef enum
|
|||
MD2_EXTVAL1 = 1<<5,
|
||||
MD2_EXTVAL2 = 1<<6,
|
||||
MD2_HNEXT = 1<<7,
|
||||
#ifdef ESLOPE
|
||||
MD2_HPREV = 1<<8,
|
||||
MD2_SLOPE = 1<<9
|
||||
MD2_FLOORROVER = 1<<9,
|
||||
#ifdef ESLOPE
|
||||
MD2_CEILINGROVER = 1<<10,
|
||||
MD2_SLOPE = 1<<11
|
||||
#else
|
||||
MD2_HPREV = 1<<8
|
||||
MD2_CEILINGROVER = 1<<10
|
||||
#endif
|
||||
} mobj_diff2_t;
|
||||
|
||||
|
@ -1451,6 +1453,10 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
diff2 |= MD2_HNEXT;
|
||||
if (mobj->hprev)
|
||||
diff2 |= MD2_HPREV;
|
||||
if (mobj->floorrover)
|
||||
diff2 |= MD2_FLOORROVER;
|
||||
if (mobj->ceilingrover)
|
||||
diff2 |= MD2_CEILINGROVER;
|
||||
#ifdef ESLOPE
|
||||
if (mobj->standingslope)
|
||||
diff2 |= MD2_SLOPE;
|
||||
|
@ -1474,6 +1480,46 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
WRITEFIXED(save_p, mobj->floorz);
|
||||
WRITEFIXED(save_p, mobj->ceilingz);
|
||||
|
||||
if (diff2 & MD2_FLOORROVER)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
size_t i = 0;
|
||||
UINT32 roverindex = 0;
|
||||
|
||||
for (rover = mobj->floorrover->target->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rover == mobj->floorrover)
|
||||
{
|
||||
roverindex = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
WRITEUINT32(save_p, (UINT32)(mobj->floorrover->target - sectors));
|
||||
WRITEUINT32(save_p, rover ? roverindex : i); // store max index to denote invalid ffloor ref
|
||||
}
|
||||
|
||||
if (diff2 & MD2_CEILINGROVER)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
size_t i = 0;
|
||||
UINT32 roverindex = 0;
|
||||
|
||||
for (rover = mobj->ceilingrover->target->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rover == mobj->ceilingrover)
|
||||
{
|
||||
roverindex = i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
WRITEUINT32(save_p, (UINT32)(mobj->ceilingrover->target - sectors));
|
||||
WRITEUINT32(save_p, rover ? roverindex : i); // store max index to denote invalid ffloor ref
|
||||
}
|
||||
|
||||
if (diff & MD_SPAWNPOINT)
|
||||
{
|
||||
size_t z;
|
||||
|
@ -2322,6 +2368,7 @@ static void LoadMobjThinker(actionf_p1 thinker)
|
|||
UINT16 diff2;
|
||||
INT32 i;
|
||||
fixed_t z, floorz, ceilingz;
|
||||
ffloor_t *floorrover = NULL, *ceilingrover = NULL;
|
||||
|
||||
diff = READUINT32(save_p);
|
||||
if (diff & MD_MORE)
|
||||
|
@ -2335,6 +2382,38 @@ static void LoadMobjThinker(actionf_p1 thinker)
|
|||
floorz = READFIXED(save_p);
|
||||
ceilingz = READFIXED(save_p);
|
||||
|
||||
if (diff2 & MD2_FLOORROVER)
|
||||
{
|
||||
size_t floor_sectornum = (size_t)READUINT32(save_p);
|
||||
size_t floor_rovernum = (size_t)READUINT32(save_p);
|
||||
ffloor_t *rover = NULL;
|
||||
size_t rovernum = 0;
|
||||
|
||||
for (rover = sectors[floor_sectornum].ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rovernum == floor_rovernum)
|
||||
break;
|
||||
rovernum++;
|
||||
}
|
||||
floorrover = rover;
|
||||
}
|
||||
|
||||
if (diff2 & MD2_CEILINGROVER)
|
||||
{
|
||||
size_t ceiling_sectornum = (size_t)READUINT32(save_p);
|
||||
size_t ceiling_rovernum = (size_t)READUINT32(save_p);
|
||||
ffloor_t *rover = NULL;
|
||||
size_t rovernum = 0;
|
||||
|
||||
for (rover = sectors[ceiling_sectornum].ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (rovernum == ceiling_rovernum)
|
||||
break;
|
||||
rovernum++;
|
||||
}
|
||||
ceilingrover = rover;
|
||||
}
|
||||
|
||||
if (diff & MD_SPAWNPOINT)
|
||||
{
|
||||
UINT16 spawnpointnum = READUINT16(save_p);
|
||||
|
@ -2359,6 +2438,8 @@ static void LoadMobjThinker(actionf_p1 thinker)
|
|||
mobj->z = z;
|
||||
mobj->floorz = floorz;
|
||||
mobj->ceilingz = ceilingz;
|
||||
mobj->floorrover = floorrover;
|
||||
mobj->ceilingrover = ceilingrover;
|
||||
|
||||
if (diff & MD_TYPE)
|
||||
mobj->type = READUINT32(save_p);
|
||||
|
|
Loading…
Reference in a new issue