mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Fixed the thing where if you thok into a solid object you spin really fast in the air without moving OR losing your momentum.
This commit is contained in:
parent
b8345aaf27
commit
fa16abf7ae
1 changed files with 22 additions and 9 deletions
31
src/p_map.c
31
src/p_map.c
|
@ -989,12 +989,18 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
// block only when jumping not high enough,
|
// block only when jumping not high enough,
|
||||||
// (dont climb max. 24units while already in air)
|
// (dont climb max. 24units while already in air)
|
||||||
// if not in air, let P_TryMove() decide if it's not too high
|
// 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
|
if (tmthing->player && tmthing->z + tmthing->height > topz
|
||||||
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
&& tmthing->z + tmthing->height < tmthing->ceilingz)
|
||||||
return false; // block while in air
|
{
|
||||||
|
tmceilingz = INT32_MIN; // block while in air
|
||||||
if (thing->flags & MF_SPRING)
|
#ifdef ESLOPE
|
||||||
|
tmceilingslope = NULL;
|
||||||
|
#endif
|
||||||
|
tmfloorthing = thing; // needed for side collision
|
||||||
|
}
|
||||||
|
else if (thing->flags & MF_SPRING)
|
||||||
;
|
;
|
||||||
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
||||||
{
|
{
|
||||||
|
@ -1026,11 +1032,18 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
// block only when jumping not high enough,
|
// block only when jumping not high enough,
|
||||||
// (dont climb max. 24units while already in air)
|
// (dont climb max. 24units while already in air)
|
||||||
// if not in air, let P_TryMove() decide if it's not too high
|
// since return false doesn't handle momentum properly,
|
||||||
if (tmthing->player && tmthing->z < topz && tmthing->z > tmthing->floorz)
|
// we lie to P_TryMove() so it's always too high
|
||||||
return false; // block while in air
|
if (tmthing->player && tmthing->z < topz
|
||||||
|
&& tmthing->z > tmthing->floorz)
|
||||||
if (thing->flags & MF_SPRING)
|
{
|
||||||
|
tmfloorz = INT32_MAX; // block while in air
|
||||||
|
#ifdef ESLOPE
|
||||||
|
tmfloorslope = NULL;
|
||||||
|
#endif
|
||||||
|
tmfloorthing = thing; // needed for side collision
|
||||||
|
}
|
||||||
|
else if (thing->flags & MF_SPRING)
|
||||||
;
|
;
|
||||||
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue