mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Merge branch 'next' into public_next
This commit is contained in:
commit
5b6310c1c6
2 changed files with 28 additions and 13 deletions
39
src/p_map.c
39
src/p_map.c
|
@ -985,18 +985,24 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
topz = thing->z - FixedMul(FRACUNIT, thing->scale);
|
topz = thing->z - thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways
|
||||||
|
|
||||||
// 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
|
{
|
||||||
|
tmfloorz = 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+tmthing->height <= thing->z+thing->height)
|
else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height)
|
||||||
{
|
{
|
||||||
tmceilingz = topz;
|
tmceilingz = topz;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
|
@ -1022,17 +1028,24 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
topz = thing->z + thing->height + FixedMul(FRACUNIT, thing->scale);
|
topz = thing->z + thing->height + thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways
|
||||||
|
|
||||||
// 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 = tmceilingz = 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 >= thing->z)
|
else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z)
|
||||||
{
|
{
|
||||||
tmfloorz = topz;
|
tmfloorz = topz;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
|
|
|
@ -6048,6 +6048,8 @@ void P_RunOverlays(void)
|
||||||
P_UnsetThingPosition(mo);
|
P_UnsetThingPosition(mo);
|
||||||
mo->x = destx;
|
mo->x = destx;
|
||||||
mo->y = desty;
|
mo->y = desty;
|
||||||
|
mo->radius = mo->target->radius;
|
||||||
|
mo->height = mo->target->height;
|
||||||
if (mo->eflags & MFE_VERTICALFLIP)
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
mo->z = (mo->target->z + mo->target->height - mo->height) - zoffs;
|
mo->z = (mo->target->z + mo->target->height - mo->height) - zoffs;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue