mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 19:21:44 +00:00
- Exhumed: Minor fixes to panning code.
* Stop panning if underwater. * Remove overload from PlayerHorizon fromd32dcd5f8e
that was causing problems for other games. * Remove static bool `plrFalling` also fromd32dcd5f8e
and add `bIsFalling` to `Player` struct, hooking up with save code as well.
This commit is contained in:
parent
726c51bf63
commit
7fcf1c94a1
3 changed files with 8 additions and 19 deletions
|
@ -39,18 +39,6 @@ struct PlayerHorizon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void addadjustment(fixed_t value)
|
|
||||||
{
|
|
||||||
if (!SyncInput())
|
|
||||||
{
|
|
||||||
adjustment += value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
horiz += q16horiz(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void resetadjustment()
|
void resetadjustment()
|
||||||
{
|
{
|
||||||
adjustment = 0;
|
adjustment = 0;
|
||||||
|
|
|
@ -1167,29 +1167,28 @@ void FuncPlayer(int a, int nDamage, int nRun)
|
||||||
}
|
}
|
||||||
|
|
||||||
sectdone:
|
sectdone:
|
||||||
static bool plrFalling = false;
|
if (!bUnderwater || !PlayerList[nPlayer].horizon.horiz.asbuild() || PlayerList[nPlayer].bIsFalling)
|
||||||
if (!PlayerList[nPlayer].horizon.horiz.asbuild() || plrFalling)
|
|
||||||
{
|
{
|
||||||
// Calculate base pan amount based on how much the player is falling.
|
// Calculate base pan amount based on how much the player is falling.
|
||||||
fixed_t dVertPan = (spr_z - sprite[nPlayerSprite].z) << 9;
|
fixed_t dVertPan = (spr_z - sprite[nPlayerSprite].z) << 9;
|
||||||
if (dVertPan != 0)
|
if (!bUnderwater && dVertPan != 0)
|
||||||
{
|
{
|
||||||
fixed_t adjustment;
|
fixed_t adjustment;
|
||||||
|
|
||||||
if (dVertPan >= IntToFixed(4))
|
if (dVertPan >= IntToFixed(4))
|
||||||
adjustment = IntToFixed(4);
|
adjustment = 4;
|
||||||
else if (dVertPan <= -IntToFixed(4))
|
else if (dVertPan <= -IntToFixed(4))
|
||||||
adjustment = -IntToFixed(4);
|
adjustment = -4;
|
||||||
else
|
else
|
||||||
adjustment = dVertPan << 1;
|
adjustment = dVertPan << 1;
|
||||||
|
|
||||||
PlayerList[nPlayer].horizon.addadjustment(adjustment);
|
PlayerList[nPlayer].horizon.addadjustment(adjustment);
|
||||||
plrFalling = true;
|
PlayerList[nPlayer].bIsFalling = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sPlayerInput[nPlayer].actions |= SB_CENTERVIEW;
|
sPlayerInput[nPlayer].actions |= SB_CENTERVIEW;
|
||||||
plrFalling = false;
|
PlayerList[nPlayer].bIsFalling = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2854,6 +2853,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Player& w, Player*
|
||||||
("field38", w.field_38)
|
("field38", w.field_38)
|
||||||
("field3a", w.field_3A)
|
("field3a", w.field_3A)
|
||||||
("field3c", w.field_3C)
|
("field3c", w.field_3C)
|
||||||
|
("bIsFalling", w.bIsFalling)
|
||||||
("seq", w.nSeq)
|
("seq", w.nSeq)
|
||||||
("horizon", w.horizon)
|
("horizon", w.horizon)
|
||||||
("angle", w.angle)
|
("angle", w.angle)
|
||||||
|
|
|
@ -71,6 +71,7 @@ struct Player
|
||||||
short field_3A;
|
short field_3A;
|
||||||
short field_3C;
|
short field_3C;
|
||||||
short nRun;
|
short nRun;
|
||||||
|
bool bIsFalling;
|
||||||
|
|
||||||
PlayerHorizon horizon;
|
PlayerHorizon horizon;
|
||||||
PlayerAngle angle;
|
PlayerAngle angle;
|
||||||
|
|
Loading…
Reference in a new issue