mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Merge branch 'master' into opengl-improvements
This commit is contained in:
commit
07c260a83e
3 changed files with 37 additions and 8 deletions
|
@ -2061,6 +2061,33 @@ void T_NoEnemiesSector(levelspecthink_t *nobaddies)
|
||||||
P_RemoveThinker(&nobaddies->thinker);
|
P_RemoveThinker(&nobaddies->thinker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// P_IsObjectOnRealGround
|
||||||
|
//
|
||||||
|
// Helper function for T_EachTimeThinker
|
||||||
|
// Like P_IsObjectOnGroundIn, except ONLY THE REAL GROUND IS CONSIDERED, NOT FOFS
|
||||||
|
// I'll consider whether to make this a more globally accessible function or whatever in future
|
||||||
|
// -- Monster Iestyn
|
||||||
|
//
|
||||||
|
static boolean P_IsObjectOnRealGround(mobj_t *mo, sector_t *sec)
|
||||||
|
{
|
||||||
|
// Is the object in reverse gravity?
|
||||||
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
{
|
||||||
|
// Detect if the player is on the ceiling.
|
||||||
|
if (mo->z+mo->height >= P_GetSpecialTopZ(mo, sec, sec))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Nope!
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Detect if the player is on the floor.
|
||||||
|
if (mo->z <= P_GetSpecialBottomZ(mo, sec, sec))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_HavePlayersEnteredArea
|
// P_HavePlayersEnteredArea
|
||||||
//
|
//
|
||||||
|
@ -2264,7 +2291,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
|
||||||
|| P_PlayerTouchingSectorSpecial(&players[i], 2, (GETSECSPECIAL(sec->special, 2))) == sec))
|
|| P_PlayerTouchingSectorSpecial(&players[i], 2, (GETSECSPECIAL(sec->special, 2))) == sec))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (floortouch == true && P_IsObjectOnGroundIn(players[i].mo, sec))
|
if (floortouch == true && P_IsObjectOnRealGround(players[i].mo, sec))
|
||||||
{
|
{
|
||||||
if (i & 1)
|
if (i & 1)
|
||||||
eachtime->var2s[i/2] |= 1;
|
eachtime->var2s[i/2] |= 1;
|
||||||
|
|
|
@ -1749,7 +1749,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
||||||
case 305: // continuous
|
case 305: // continuous
|
||||||
case 306: // each time
|
case 306: // each time
|
||||||
case 307: // once
|
case 307: // once
|
||||||
if (!(actor && actor->player && actor->player->charability != dist/10))
|
if (!(actor && actor->player && actor->player->charability == dist/10))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case 309: // continuous
|
case 309: // continuous
|
||||||
|
|
14
src/p_user.c
14
src/p_user.c
|
@ -1267,11 +1267,12 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec)
|
||||||
if (!(rover->flags & FF_EXISTS))
|
if (!(rover->flags & FF_EXISTS))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the FOF is configured to let players through, continue.
|
// If the FOF is configured to let the object through, continue.
|
||||||
if (!(rover->flags & FF_BLOCKPLAYER) && (rover->flags & FF_BLOCKOTHERS))
|
if (!((rover->flags & FF_BLOCKPLAYER && mo->player)
|
||||||
|
|| (rover->flags & FF_BLOCKOTHERS && !mo->player)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the the platform is intangile from below, continue.
|
// If the the platform is intangible from below, continue.
|
||||||
if (rover->flags & FF_PLATFORM)
|
if (rover->flags & FF_PLATFORM)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -1300,11 +1301,12 @@ boolean P_IsObjectOnGroundIn(mobj_t *mo, sector_t *sec)
|
||||||
if (!(rover->flags & FF_EXISTS))
|
if (!(rover->flags & FF_EXISTS))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the FOF is configured to let players through, continue.
|
// If the FOF is configured to let the object through, continue.
|
||||||
if (!(rover->flags & FF_BLOCKPLAYER) && (rover->flags & FF_BLOCKOTHERS))
|
if (!((rover->flags & FF_BLOCKPLAYER && mo->player)
|
||||||
|
|| (rover->flags & FF_BLOCKOTHERS && !mo->player)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the the platform is intangile from above, continue.
|
// If the the platform is intangible from above, continue.
|
||||||
if (rover->flags & FF_REVERSEPLATFORM)
|
if (rover->flags & FF_REVERSEPLATFORM)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue