Merge branch 'master' into sal-waypoints

This commit is contained in:
TehRealSalt 2019-10-28 20:22:37 -04:00
commit 150c985ce5
3 changed files with 25 additions and 19 deletions

View file

@ -2930,18 +2930,22 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
if (!(thing->flags & MF_NOCLIP))
{
//All things are affected by their scale.
fixed_t maxstep = FixedMul(MAXSTEPMOVE, mapobjectscale);
const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale);
fixed_t maxstep = maxstepmove;
if (thing->player)
{
if (thing->player->kartstuff[k_waterskip])
maxstep += maxstepmove; // Force some stepmove when waterskipping
// If using type Section1:13, double the maxstep.
if (P_PlayerTouchingSectorSpecial(thing->player, 1, 13)
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 13)
maxstep <<= 1;
maxstep += maxstepmove;
// 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_PlayerTouchingSectorSpecial(thing->player, 1, 12)
|| GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 12)
maxstep = 0;
maxstep -= maxstepmove;
// Don't 'step up' while springing,
// Only step up "if needed".

View file

@ -1269,6 +1269,8 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
P_PlayerFlip(mo);
if (mo->player->kartstuff[k_pogospring])
gravityadd = (5*gravityadd)/2;
if (mo->player->kartstuff[k_waterskip])
gravityadd = (4*gravityadd)/3;
}
else
{
@ -3295,26 +3297,19 @@ void P_MobjCheckWater(mobj_t *mobj)
// skipping stone!
if (p && p->kartstuff[k_waterskip] < 2
&& ((p->speed/3 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water.
|| (p->speed > K_GetKartSpeed(p,false)/3 && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more!
|| (p->speed > 20*mapobjectscale && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more!
&& ((!(mobj->eflags & MFE_VERTICALFLIP) && thingtop - mobj->momz > mobj->watertop)
|| ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z - mobj->momz < mobj->waterbottom)))
{
const fixed_t min = 6<<FRACBITS;
//const fixed_t max = 8<<FRACBITS;
const fixed_t hop = 5<<FRACBITS;
mobj->momx = mobj->momx/2;
mobj->momy = mobj->momy/2;
mobj->momz = -mobj->momz/2;
mobj->momx = (4*mobj->momx)/5;
mobj->momy = (4*mobj->momy)/5;
if (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->momz < FixedMul(min, mobj->scale))
mobj->momz = FixedMul(min, mobj->scale);
else if (mobj->eflags & MFE_VERTICALFLIP && mobj->momz > FixedMul(-min, mobj->scale))
mobj->momz = FixedMul(-min, mobj->scale);
/*if (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->momz > FixedMul(max, mobj->scale))
mobj->momz = FixedMul(max, mobj->scale);
else if (mobj->eflags & MFE_VERTICALFLIP && mobj->momz < FixedMul(-max, mobj->scale))
mobj->momz = FixedMul(-max, mobj->scale);*/
if (mobj->eflags & MFE_VERTICALFLIP)
mobj->momz = FixedMul(-hop, mobj->scale);
else
mobj->momz = FixedMul(hop, mobj->scale);
p->kartstuff[k_waterskip]++;
}

View file

@ -210,7 +210,11 @@ void Z_Free(void *ptr)
static void *xm(size_t size)
{
const size_t padedsize = size+sizeof (size_t);
void *p = malloc(padedsize);
void *p;
if (padedsize < size)/* overflow check */
I_Error("You are allocating memory too large!");
p = malloc(padedsize);
if (p == NULL)
{
@ -254,6 +258,9 @@ void *Z_MallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits)
CONS_Debug(DBG_MEMORY, "Z_Malloc %s:%d\n", file, line);
#endif
if (blocksize < size)/* overflow check */
I_Error("You are allocating memory too large!");
block = xm(sizeof *block);
#ifdef HAVE_VALGRIND
padsize += (1<<sizeof(size_t))*2;