mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-26 03:00:55 +00:00
Merge branch 'jumping_springs' into 'next'
No more jumping springs FOR REAL! The issue was that because both them and the player had MF_SOLID, the tmfloorz of the spring was getting set to above the player (or vicea versa with tmceilingz), forcing it upwards with them under certain circumstances. Now, springs only acknowledge the solidity (for purpose of tmfloorz/tmceilingz) of objects they CAN'T launch. Test with ```<root>/toaster/srb2springsagain.exe``` and ```<root>/DrTapeworm/springtest.wad```, via Mystic's secret server that [SOME jerk](https://www.youtube.com/watch?v=TRjXE_ZMT2s) keeps leaking from. See merge request !199
This commit is contained in:
commit
663d8a1f00
1 changed files with 8 additions and 6 deletions
14
src/p_map.c
14
src/p_map.c
|
@ -956,6 +956,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (iwassprung) // this spring caused you to gain MFE_SPRUNG just now...
|
||||
return false; // "cancel" P_TryMove via blocking so you keep your current position
|
||||
}
|
||||
else if (tmthing->flags & MF_SPRING && (thing->player || thing->flags & MF_PUSHABLE))
|
||||
; // Fix a few nasty spring-jumping bugs that happen sometimes.
|
||||
// Monitors are not treated as solid to players who are jumping, spinning or gliding,
|
||||
// unless it's a CTF team monitor and you're on the wrong team
|
||||
else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)
|
||||
|
@ -987,11 +989,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
topz = thing->z - thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways
|
||||
|
||||
if (thing->flags & MF_SPRING)
|
||||
;
|
||||
// block only when jumping not high enough,
|
||||
// (dont climb max. 24units while already in air)
|
||||
// since return false doesn't handle momentum properly,
|
||||
// we lie to P_TryMove() so it's always too high
|
||||
if (tmthing->player && tmthing->z + tmthing->height > topz
|
||||
else if (tmthing->player && tmthing->z + tmthing->height > topz
|
||||
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
||||
{
|
||||
tmfloorz = tmceilingz = topz; // block while in air
|
||||
|
@ -1000,8 +1004,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
#endif
|
||||
tmfloorthing = thing; // needed for side collision
|
||||
}
|
||||
else if (thing->flags & MF_SPRING)
|
||||
;
|
||||
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
||||
{
|
||||
tmceilingz = topz;
|
||||
|
@ -1030,11 +1032,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
topz = thing->z + thing->height + thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways
|
||||
|
||||
if (thing->flags & MF_SPRING)
|
||||
;
|
||||
// block only when jumping not high enough,
|
||||
// (dont climb max. 24units while already in air)
|
||||
// since return false doesn't handle momentum properly,
|
||||
// we lie to P_TryMove() so it's always too high
|
||||
if (tmthing->player && tmthing->z < topz
|
||||
else if (tmthing->player && tmthing->z < topz
|
||||
&& tmthing->z > tmthing->floorz)
|
||||
{
|
||||
tmfloorz = tmceilingz = topz; // block while in air
|
||||
|
@ -1043,8 +1047,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
#endif
|
||||
tmfloorthing = thing; // needed for side collision
|
||||
}
|
||||
else if (thing->flags & MF_SPRING)
|
||||
;
|
||||
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
||||
{
|
||||
tmfloorz = topz;
|
||||
|
|
Loading…
Reference in a new issue