mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'special-sector-tweak' into 'master'
Fix step-up on stairs for other objects (Orbinaut VS Toxic Palace Stairs) See merge request KartKrew/Kart!201
This commit is contained in:
commit
b13ebd6d15
8 changed files with 114 additions and 116 deletions
27
src/k_kart.c
27
src/k_kart.c
|
|
@ -1533,20 +1533,16 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
|
|
||||||
\return boolean
|
\return boolean
|
||||||
*/
|
*/
|
||||||
static UINT8 K_CheckOffroadCollide(mobj_t *mo, sector_t *sec)
|
static UINT8 K_CheckOffroadCollide(mobj_t *mo)
|
||||||
{
|
{
|
||||||
UINT8 i;
|
UINT8 i;
|
||||||
sector_t *sec2;
|
|
||||||
|
|
||||||
I_Assert(mo != NULL);
|
I_Assert(mo != NULL);
|
||||||
I_Assert(!P_MobjWasRemoved(mo));
|
I_Assert(!P_MobjWasRemoved(mo));
|
||||||
|
|
||||||
sec2 = P_ThingOnSpecial3DFloor(mo);
|
|
||||||
|
|
||||||
for (i = 2; i < 5; i++)
|
for (i = 2; i < 5; i++)
|
||||||
{
|
{
|
||||||
if ((sec2 && GETSECSPECIAL(sec2->special, 1) == i)
|
if (P_MobjTouchingSectorSpecial(mo, 1, i, true))
|
||||||
|| (P_IsObjectOnRealGround(mo, sec) && GETSECSPECIAL(sec->special, 1) == i))
|
|
||||||
return i-1;
|
return i-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1561,25 +1557,16 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo, sector_t *sec)
|
||||||
*/
|
*/
|
||||||
static void K_UpdateOffroad(player_t *player)
|
static void K_UpdateOffroad(player_t *player)
|
||||||
{
|
{
|
||||||
fixed_t offroad;
|
fixed_t offroadstrength = (K_CheckOffroadCollide(player->mo) << FRACBITS);
|
||||||
sector_t *nextsector = R_PointInSubsector(
|
|
||||||
player->mo->x + player->mo->momx*2, player->mo->y + player->mo->momy*2)->sector;
|
|
||||||
UINT8 offroadstrength = K_CheckOffroadCollide(player->mo, nextsector);
|
|
||||||
|
|
||||||
// If you are in offroad, a timer starts.
|
// If you are in offroad, a timer starts.
|
||||||
if (offroadstrength)
|
if (offroadstrength)
|
||||||
{
|
{
|
||||||
if (K_CheckOffroadCollide(player->mo, player->mo->subsector->sector) && player->kartstuff[k_offroad] == 0)
|
if (player->kartstuff[k_offroad] < offroadstrength)
|
||||||
player->kartstuff[k_offroad] = TICRATE;
|
player->kartstuff[k_offroad] += offroadstrength / TICRATE;
|
||||||
|
|
||||||
if (player->kartstuff[k_offroad] > 0)
|
if (player->kartstuff[k_offroad] > offroadstrength)
|
||||||
{
|
player->kartstuff[k_offroad] = offroadstrength;
|
||||||
offroad = (offroadstrength << FRACBITS) / TICRATE;
|
|
||||||
player->kartstuff[k_offroad] += offroad;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player->kartstuff[k_offroad] > (offroadstrength << FRACBITS))
|
|
||||||
player->kartstuff[k_offroad] = (offroadstrength << FRACBITS);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player->kartstuff[k_offroad] = 0;
|
player->kartstuff[k_offroad] = 0;
|
||||||
|
|
|
||||||
|
|
@ -1313,15 +1313,16 @@ static int lib_pExplodeMissile(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_pPlayerTouchingSectorSpecial(lua_State *L)
|
static int lib_pMobjTouchingSectorSpecial(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
INT32 section = (INT32)luaL_checkinteger(L, 2);
|
INT32 section = (INT32)luaL_checkinteger(L, 2);
|
||||||
INT32 number = (INT32)luaL_checkinteger(L, 3);
|
INT32 number = (INT32)luaL_checkinteger(L, 3);
|
||||||
|
boolean touchground = lua_optboolean(L, 4);
|
||||||
//HUDSAFE
|
//HUDSAFE
|
||||||
if (!player)
|
if (!mo)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
LUA_PushUserdata(L, P_PlayerTouchingSectorSpecial(player, section, number), META_SECTOR);
|
LUA_PushUserdata(L, P_MobjTouchingSectorSpecial(mo, section, number, touchground), META_SECTOR);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2736,7 +2737,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_SetMobjStateNF",lib_pSetMobjStateNF},
|
{"P_SetMobjStateNF",lib_pSetMobjStateNF},
|
||||||
{"P_DoSuperTransformation",lib_pDoSuperTransformation},
|
{"P_DoSuperTransformation",lib_pDoSuperTransformation},
|
||||||
{"P_ExplodeMissile",lib_pExplodeMissile},
|
{"P_ExplodeMissile",lib_pExplodeMissile},
|
||||||
{"P_PlayerTouchingSectorSpecial",lib_pPlayerTouchingSectorSpecial},
|
{"P_MobjTouchingSectorSpecial",lib_pMobjTouchingSectorSpecial},
|
||||||
{"P_FindSpecialLineFromTag",lib_pFindSpecialLineFromTag},
|
{"P_FindSpecialLineFromTag",lib_pFindSpecialLineFromTag},
|
||||||
{"P_SwitchWeather",lib_pSwitchWeather},
|
{"P_SwitchWeather",lib_pSwitchWeather},
|
||||||
{"P_LinedefExecute",lib_pLinedefExecute},
|
{"P_LinedefExecute",lib_pLinedefExecute},
|
||||||
|
|
|
||||||
|
|
@ -2276,7 +2276,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(players[i].mo->subsector->sector == sec
|
if (!(players[i].mo->subsector->sector == sec
|
||||||
|| P_PlayerTouchingSectorSpecial(&players[i], 2, (GETSECSPECIAL(sec->special, 2))) == sec))
|
|| P_MobjTouchingSectorSpecial(players[i].mo, 2, (GETSECSPECIAL(sec->special, 2)), false) == sec))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (floortouch == true && P_IsObjectOnRealGround(players[i].mo, sec))
|
if (floortouch == true && P_IsObjectOnRealGround(players[i].mo, sec))
|
||||||
|
|
|
||||||
|
|
@ -925,7 +925,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
special->fuse = 1;
|
special->fuse = 1;
|
||||||
special->flags2 |= MF2_JUSTATTACKED;
|
special->flags2 |= MF2_JUSTATTACKED;
|
||||||
|
|
||||||
if (!P_PlayerTouchingSectorSpecial(player, 4, 2 + flagteam))
|
if (!P_MobjTouchingSectorSpecial(player->mo, 4, 2 + flagteam, false))
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("%s returned the %c%s%c to base.\n"), plname, flagcolor, flagtext, 0x80);
|
CONS_Printf(M_GetText("%s returned the %c%s%c to base.\n"), plname, flagcolor, flagtext, 0x80);
|
||||||
|
|
||||||
|
|
|
||||||
32
src/p_map.c
32
src/p_map.c
|
|
@ -2790,28 +2790,15 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale);
|
const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale);
|
||||||
fixed_t maxstep = maxstepmove;
|
fixed_t maxstep = maxstepmove;
|
||||||
|
|
||||||
if (thing->player)
|
if (thing->player && thing->player->kartstuff[k_waterskip])
|
||||||
{
|
maxstep += maxstepmove; // Add some extra stepmove when waterskipping
|
||||||
if (thing->player->kartstuff[k_waterskip])
|
|
||||||
maxstep += maxstepmove; // Force some stepmove when waterskipping
|
|
||||||
|
|
||||||
// If using type Section1:13, double the maxstep.
|
// If using type Section1:13, double the maxstep.
|
||||||
if (P_PlayerTouchingSectorSpecial(thing->player, 1, 13)
|
if (P_MobjTouchingSectorSpecial(thing, 1, 13, false))
|
||||||
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 13)
|
maxstep <<= 1;
|
||||||
maxstep += maxstepmove;
|
// If using type Section1:12, no maxstep. For short walls, like Egg Zeppelin
|
||||||
// If using type Section1:12, no maxstep. For ledges you don't want the player to climb! (see: Egg Zeppelin & SMK port walls)
|
else if (P_MobjTouchingSectorSpecial(thing, 1, 12, false))
|
||||||
else if (P_PlayerTouchingSectorSpecial(thing->player, 1, 12)
|
|
||||||
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 12)
|
|
||||||
maxstep -= maxstepmove;
|
|
||||||
|
|
||||||
// Don't 'step up' while springing,
|
|
||||||
// Only step up "if needed".
|
|
||||||
/* // SRB2kart - don't need
|
|
||||||
if (thing->state == &states[S_PLAY_SPRING]
|
|
||||||
&& P_MobjFlip(thing)*thing->momz > FixedMul(FRACUNIT, thing->scale))
|
|
||||||
maxstep = 0;
|
maxstep = 0;
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
if (thing->type == MT_SKIM)
|
if (thing->type == MT_SKIM)
|
||||||
maxstep = 0;
|
maxstep = 0;
|
||||||
|
|
@ -2834,12 +2821,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
return false; // mobj must lower itself to fit
|
return false; // mobj must lower itself to fit
|
||||||
|
|
||||||
// Ramp test
|
// Ramp test
|
||||||
if (maxstep > 0 && !(
|
if ((maxstep > 0) && !(P_MobjTouchingSectorSpecial(thing, 1, 14, false)))
|
||||||
thing->player && (
|
|
||||||
P_PlayerTouchingSectorSpecial(thing->player, 1, 14)
|
|
||||||
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
|
// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
|
||||||
// step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more.
|
// step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more.
|
||||||
|
|
|
||||||
28
src/p_mobj.c
28
src/p_mobj.c
|
|
@ -8355,14 +8355,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
|
|
||||||
P_Thrust(mobj, mobj->angle, thrustamount);
|
P_Thrust(mobj, mobj->angle, thrustamount);
|
||||||
|
|
||||||
if (grounded)
|
if (P_MobjTouchingSectorSpecial(mobj, 3, 1, true))
|
||||||
{
|
|
||||||
sector_t *sec2 = P_ThingOnSpecial3DFloor(mobj);
|
|
||||||
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|
|
||||||
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
|
|
||||||
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
|
|
||||||
K_DoPogoSpring(mobj, 0, 1);
|
K_DoPogoSpring(mobj, 0, 1);
|
||||||
}
|
|
||||||
|
|
||||||
if (mobj->threshold > 0)
|
if (mobj->threshold > 0)
|
||||||
mobj->threshold--;
|
mobj->threshold--;
|
||||||
|
|
@ -8374,7 +8368,6 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
case MT_JAWZ:
|
case MT_JAWZ:
|
||||||
{
|
{
|
||||||
sector_t *sec2;
|
|
||||||
mobj_t *ghost = P_SpawnGhostMobj(mobj);
|
mobj_t *ghost = P_SpawnGhostMobj(mobj);
|
||||||
|
|
||||||
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
|
if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player)
|
||||||
|
|
@ -8392,10 +8385,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
|
|
||||||
K_DriftDustHandling(mobj);
|
K_DriftDustHandling(mobj);
|
||||||
|
|
||||||
sec2 = P_ThingOnSpecial3DFloor(mobj);
|
if (P_MobjTouchingSectorSpecial(mobj, 3, 1, true))
|
||||||
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|
|
||||||
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
|
|
||||||
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
|
|
||||||
K_DoPogoSpring(mobj, 0, 1);
|
K_DoPogoSpring(mobj, 0, 1);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
@ -8447,14 +8437,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy);
|
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy);
|
||||||
P_Thrust(mobj, mobj->angle, thrustamount);
|
P_Thrust(mobj, mobj->angle, thrustamount);
|
||||||
|
|
||||||
if (grounded)
|
if (P_MobjTouchingSectorSpecial(mobj, 3, 1, true))
|
||||||
{
|
|
||||||
sector_t *sec2 = P_ThingOnSpecial3DFloor(mobj);
|
|
||||||
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
|
|
||||||
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
|
|
||||||
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
|
|
||||||
K_DoPogoSpring(mobj, 0, 1);
|
K_DoPogoSpring(mobj, 0, 1);
|
||||||
}
|
|
||||||
|
|
||||||
if (mobj->threshold > 0)
|
if (mobj->threshold > 0)
|
||||||
mobj->threshold--;
|
mobj->threshold--;
|
||||||
|
|
@ -9675,13 +9659,9 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
break;
|
break;
|
||||||
case MT_BLUEFLAG:
|
case MT_BLUEFLAG:
|
||||||
case MT_REDFLAG:
|
case MT_REDFLAG:
|
||||||
{
|
if (P_MobjTouchingSectorSpecial(mobj, 4, 2, false))
|
||||||
sector_t *sec2;
|
|
||||||
sec2 = P_ThingOnSpecial3DFloor(mobj);
|
|
||||||
if ((sec2 && GETSECSPECIAL(sec2->special, 4) == 2) || (GETSECSPECIAL(mobj->subsector->sector->special, 4) == 2))
|
|
||||||
mobj->fuse = 1; // Return to base.
|
mobj->fuse = 1; // Return to base.
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case MT_CANNONBALL:
|
case MT_CANNONBALL:
|
||||||
#ifdef FLOORSPLATS
|
#ifdef FLOORSPLATS
|
||||||
R_AddFloorSplat(mobj->tracer->subsector, mobj->tracer, "TARGET", mobj->tracer->x,
|
R_AddFloorSplat(mobj->tracer->subsector, mobj->tracer, "TARGET", mobj->tracer->x,
|
||||||
|
|
|
||||||
110
src/p_spec.c
110
src/p_spec.c
|
|
@ -3304,7 +3304,7 @@ boolean P_IsFlagAtBase(mobjtype_t flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_PlayerTouchingSectorSpecial
|
// P_MobjTouchingSectorSpecial
|
||||||
//
|
//
|
||||||
// Replaces the old player->specialsector.
|
// Replaces the old player->specialsector.
|
||||||
// This allows a player to touch more than
|
// This allows a player to touch more than
|
||||||
|
|
@ -3314,60 +3314,86 @@ boolean P_IsFlagAtBase(mobjtype_t flag)
|
||||||
// the particular type that it finds.
|
// the particular type that it finds.
|
||||||
// Returns NULL if it doesn't find it.
|
// Returns NULL if it doesn't find it.
|
||||||
//
|
//
|
||||||
sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 number)
|
// Sal: Couldn't see a reason for this to
|
||||||
|
// be a player_t only function.
|
||||||
|
//
|
||||||
|
sector_t *P_MobjTouchingSectorSpecial(mobj_t *mo, INT32 section, INT32 number, boolean touchground)
|
||||||
{
|
{
|
||||||
|
fixed_t topheight, bottomheight;
|
||||||
msecnode_t *node;
|
msecnode_t *node;
|
||||||
ffloor_t *rover;
|
ffloor_t *rover;
|
||||||
|
|
||||||
if (!player->mo)
|
if (!mo)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Check default case first
|
// Check default case first
|
||||||
if (GETSECSPECIAL(player->mo->subsector->sector->special, section) == number)
|
if (GETSECSPECIAL(mo->subsector->sector->special, section) == number)
|
||||||
return player->mo->subsector->sector;
|
{
|
||||||
|
if (touchground)
|
||||||
|
{
|
||||||
|
topheight = P_GetSpecialTopZ(mo, mo->subsector->sector, mo->subsector->sector);
|
||||||
|
bottomheight = P_GetSpecialBottomZ(mo, mo->subsector->sector, mo->subsector->sector);
|
||||||
|
|
||||||
|
// Thing must be on top of the floor to be affected...
|
||||||
|
if (mo->subsector->sector->flags & SF_FLIPSPECIAL_FLOOR)
|
||||||
|
{
|
||||||
|
if (!(mo->eflags & MFE_VERTICALFLIP) && mo->z <= bottomheight)
|
||||||
|
return mo->subsector->sector;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mo->subsector->sector->flags & SF_FLIPSPECIAL_CEILING)
|
||||||
|
{
|
||||||
|
if ((mo->eflags & MFE_VERTICALFLIP) && mo->z + mo->height >= topheight)
|
||||||
|
return mo->subsector->sector;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return mo->subsector->sector;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Hmm.. maybe there's a FOF that has it...
|
// Hmm.. maybe there's a FOF that has it...
|
||||||
for (rover = player->mo->subsector->sector->ffloors; rover; rover = rover->next)
|
for (rover = mo->subsector->sector->ffloors; rover; rover = rover->next)
|
||||||
{
|
{
|
||||||
fixed_t topheight, bottomheight;
|
|
||||||
|
|
||||||
if (GETSECSPECIAL(rover->master->frontsector->special, section) != number)
|
if (GETSECSPECIAL(rover->master->frontsector->special, section) != number)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(rover->flags & FF_EXISTS))
|
if (!(rover->flags & FF_EXISTS))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector);
|
topheight = P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector);
|
||||||
bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector);
|
bottomheight = P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector);
|
||||||
|
|
||||||
// Check the 3D floor's type...
|
// Check the 3D floor's type...
|
||||||
if (rover->flags & FF_BLOCKPLAYER)
|
if (((rover->flags & FF_BLOCKPLAYER) && mo->player)
|
||||||
|
|| ((rover->flags & FF_BLOCKOTHERS) && !mo->player))
|
||||||
{
|
{
|
||||||
// Thing must be on top of the floor to be affected...
|
// Thing must be on top of the floor to be affected...
|
||||||
if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)
|
if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)
|
||||||
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING))
|
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING))
|
||||||
{
|
{
|
||||||
if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != topheight)
|
if ((mo->eflags & MFE_VERTICALFLIP) || mo->z != topheight)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)
|
else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)
|
||||||
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR))
|
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR))
|
||||||
{
|
{
|
||||||
if (!(player->mo->eflags & MFE_VERTICALFLIP)
|
if (!(mo->eflags & MFE_VERTICALFLIP)
|
||||||
|| player->mo->z + player->mo->height != bottomheight)
|
|| mo->z + mo->height != bottomheight)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH)
|
else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH)
|
||||||
{
|
{
|
||||||
if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == bottomheight)
|
if (!((mo->eflags & MFE_VERTICALFLIP && mo->z + mo->height == bottomheight)
|
||||||
|| (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == topheight)))
|
|| (!(mo->eflags & MFE_VERTICALFLIP) && mo->z == topheight)))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Water and DEATH FOG!!! heh
|
// Water and DEATH FOG!!! heh
|
||||||
if (player->mo->z > topheight || (player->mo->z + player->mo->height) < bottomheight)
|
if (mo->z > topheight || (mo->z + mo->height) < bottomheight)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3375,64 +3401,86 @@ sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 n
|
||||||
return rover->master->frontsector;
|
return rover->master->frontsector;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (node = player->mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next)
|
||||||
{
|
{
|
||||||
if (GETSECSPECIAL(node->m_sector->special, section) == number)
|
if (GETSECSPECIAL(node->m_sector->special, section) == number)
|
||||||
{
|
{
|
||||||
// This sector has the special we're looking for, but
|
// This sector has the special we're looking for, but
|
||||||
// are we allowed to touch it?
|
// are we allowed to touch it?
|
||||||
if (node->m_sector == player->mo->subsector->sector
|
if (node->m_sector == mo->subsector->sector
|
||||||
|| (node->m_sector->flags & SF_TRIGGERSPECIAL_TOUCH))
|
|| (node->m_sector->flags & SF_TRIGGERSPECIAL_TOUCH))
|
||||||
|
{
|
||||||
|
if (touchground)
|
||||||
|
{
|
||||||
|
topheight = P_GetSpecialTopZ(mo, node->m_sector, node->m_sector);
|
||||||
|
bottomheight = P_GetSpecialBottomZ(mo, node->m_sector, node->m_sector);
|
||||||
|
|
||||||
|
// Thing must be on top of the floor to be affected...
|
||||||
|
if (node->m_sector->flags & SF_FLIPSPECIAL_FLOOR)
|
||||||
|
{
|
||||||
|
if (!(mo->eflags & MFE_VERTICALFLIP) && mo->z <= bottomheight)
|
||||||
return node->m_sector;
|
return node->m_sector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node->m_sector->flags & SF_FLIPSPECIAL_CEILING)
|
||||||
|
{
|
||||||
|
if ((mo->eflags & MFE_VERTICALFLIP) && mo->z + mo->height >= topheight)
|
||||||
|
return node->m_sector;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return node->m_sector;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Hmm.. maybe there's a FOF that has it...
|
// Hmm.. maybe there's a FOF that has it...
|
||||||
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
for (rover = node->m_sector->ffloors; rover; rover = rover->next)
|
||||||
{
|
{
|
||||||
fixed_t topheight, bottomheight;
|
|
||||||
|
|
||||||
if (GETSECSPECIAL(rover->master->frontsector->special, section) != number)
|
if (GETSECSPECIAL(rover->master->frontsector->special, section) != number)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(rover->flags & FF_EXISTS))
|
if (!(rover->flags & FF_EXISTS))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector);
|
topheight = P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector);
|
||||||
bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector);
|
bottomheight = P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector);
|
||||||
|
|
||||||
// Check the 3D floor's type...
|
// Check the 3D floor's type...
|
||||||
if (rover->flags & FF_BLOCKPLAYER)
|
if (((rover->flags & FF_BLOCKPLAYER) && mo->player)
|
||||||
|
|| ((rover->flags & FF_BLOCKOTHERS) && !mo->player))
|
||||||
{
|
{
|
||||||
// Thing must be on top of the floor to be affected...
|
// Thing must be on top of the floor to be affected...
|
||||||
if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)
|
if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)
|
||||||
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING))
|
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING))
|
||||||
{
|
{
|
||||||
if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != topheight)
|
if ((mo->eflags & MFE_VERTICALFLIP) || mo->z != topheight)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)
|
else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)
|
||||||
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR))
|
&& !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR))
|
||||||
{
|
{
|
||||||
if (!(player->mo->eflags & MFE_VERTICALFLIP)
|
if (!(mo->eflags & MFE_VERTICALFLIP)
|
||||||
|| player->mo->z + player->mo->height != bottomheight)
|
|| mo->z + mo->height != bottomheight)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH)
|
else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH)
|
||||||
{
|
{
|
||||||
if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == bottomheight)
|
if (!((mo->eflags & MFE_VERTICALFLIP && mo->z + mo->height == bottomheight)
|
||||||
|| (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == topheight)))
|
|| (!(mo->eflags & MFE_VERTICALFLIP) && mo->z == topheight)))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Water and DEATH FOG!!! heh
|
// Water and DEATH FOG!!! heh
|
||||||
if (player->mo->z > topheight || (player->mo->z + player->mo->height) < bottomheight)
|
if (mo->z > topheight || (mo->z + mo->height) < bottomheight)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This FOF has the special we're looking for, but are we allowed to touch it?
|
// This FOF has the special we're looking for, but are we allowed to touch it?
|
||||||
if (node->m_sector == player->mo->subsector->sector
|
if (node->m_sector == mo->subsector->sector
|
||||||
|| (rover->master->frontsector->flags & SF_TRIGGERSPECIAL_TOUCH))
|
|| (rover->master->frontsector->flags & SF_TRIGGERSPECIAL_TOUCH))
|
||||||
return rover->master->frontsector;
|
return rover->master->frontsector;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ void P_SpawnSpecials(INT32 fromnetsave);
|
||||||
|
|
||||||
// every tic
|
// every tic
|
||||||
void P_UpdateSpecials(void);
|
void P_UpdateSpecials(void);
|
||||||
sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 number);
|
sector_t *P_MobjTouchingSectorSpecial(mobj_t *mo, INT32 section, INT32 number, boolean touchground);
|
||||||
void P_PlayerInSpecialSector(player_t *player);
|
void P_PlayerInSpecialSector(player_t *player);
|
||||||
void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *roversector);
|
void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *roversector);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue