mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
Fix NiGHTS drill constantly starting if you're moving sideways on ground
Also disabled normal mobj friction from NiGHTS and tweaked bouncing code just in case?
This commit is contained in:
parent
89ce257248
commit
ea1cac8e24
1 changed files with 26 additions and 12 deletions
14
src/p_mobj.c
14
src/p_mobj.c
|
@ -1900,6 +1900,9 @@ void P_XYMovement(mobj_t *mo)
|
||||||
if (player && player->homing) // no friction for homing
|
if (player && player->homing) // no friction for homing
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (player && player->pflags & PF_NIGHTSMODE)
|
||||||
|
return; // no friction for NiGHTS players
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
|
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
|
||||||
&& (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes
|
&& (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes
|
||||||
|
@ -2655,12 +2658,17 @@ static void P_PlayerZMovement(mobj_t *mo)
|
||||||
mo->z = mo->floorz;
|
mo->z = mo->floorz;
|
||||||
|
|
||||||
if (mo->player->pflags & PF_NIGHTSMODE)
|
if (mo->player->pflags & PF_NIGHTSMODE)
|
||||||
|
{
|
||||||
|
// bounce off floor if you were flying towards it
|
||||||
|
if ((mo->eflags & MFE_VERTICALFLIP && mo->player->flyangle > 0 && mo->player->flyangle < 180)
|
||||||
|
|| (!(mo->eflags & MFE_VERTICALFLIP) && mo->player->flyangle > 180 && mo->player->flyangle <= 359))
|
||||||
{
|
{
|
||||||
if (mo->player->flyangle < 90 || mo->player->flyangle >= 270)
|
if (mo->player->flyangle < 90 || mo->player->flyangle >= 270)
|
||||||
mo->player->flyangle += P_MobjFlip(mo)*90;
|
mo->player->flyangle += P_MobjFlip(mo)*90;
|
||||||
else
|
else
|
||||||
mo->player->flyangle -= P_MobjFlip(mo)*90;
|
mo->player->flyangle -= P_MobjFlip(mo)*90;
|
||||||
mo->player->speed = FixedMul(mo->player->speed, 4*FRACUNIT/5);
|
mo->player->speed = FixedMul(mo->player->speed, 4*FRACUNIT/5);
|
||||||
|
}
|
||||||
goto nightsdone;
|
goto nightsdone;
|
||||||
}
|
}
|
||||||
// Get up if you fell.
|
// Get up if you fell.
|
||||||
|
@ -2850,6 +2858,10 @@ nightsdone:
|
||||||
mo->z = mo->ceilingz - mo->height;
|
mo->z = mo->ceilingz - mo->height;
|
||||||
|
|
||||||
if (mo->player->pflags & PF_NIGHTSMODE)
|
if (mo->player->pflags & PF_NIGHTSMODE)
|
||||||
|
{
|
||||||
|
// bounce off ceiling if you were flying towards it
|
||||||
|
if ((mo->eflags & MFE_VERTICALFLIP && mo->player->flyangle > 180 && mo->player->flyangle <= 359)
|
||||||
|
|| (!(mo->eflags & MFE_VERTICALFLIP) && mo->player->flyangle > 0 && mo->player->flyangle < 180))
|
||||||
{
|
{
|
||||||
if (mo->player->flyangle < 90 || mo->player->flyangle >= 270)
|
if (mo->player->flyangle < 90 || mo->player->flyangle >= 270)
|
||||||
mo->player->flyangle -= P_MobjFlip(mo)*90;
|
mo->player->flyangle -= P_MobjFlip(mo)*90;
|
||||||
|
@ -2858,6 +2870,7 @@ nightsdone:
|
||||||
mo->player->flyangle %= 360;
|
mo->player->flyangle %= 360;
|
||||||
mo->player->speed = FixedMul(mo->player->speed, 4*FRACUNIT/5);
|
mo->player->speed = FixedMul(mo->player->speed, 4*FRACUNIT/5);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check for "Mario" blocks to hit and bounce them
|
// Check for "Mario" blocks to hit and bounce them
|
||||||
if (P_MobjFlip(mo)*mo->momz > 0)
|
if (P_MobjFlip(mo)*mo->momz > 0)
|
||||||
|
@ -3719,6 +3732,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!(mobj->player->pflags & PF_NIGHTSMODE)) // "jumping" is used for drilling
|
||||||
mobj->player->jumping = 0;
|
mobj->player->jumping = 0;
|
||||||
mobj->player->pflags &= ~PF_JUMPED;
|
mobj->player->pflags &= ~PF_JUMPED;
|
||||||
if (mobj->player->secondjump || mobj->player->powers[pw_tailsfly])
|
if (mobj->player->secondjump || mobj->player->powers[pw_tailsfly])
|
||||||
|
|
Loading…
Reference in a new issue