mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- Exhumed: Fix player panning when walking up/down steps while horizon is 0.
This commit is contained in:
parent
b034d9e059
commit
d32dcd5f8e
2 changed files with 38 additions and 0 deletions
|
@ -39,6 +39,18 @@ struct PlayerHorizon
|
|||
}
|
||||
}
|
||||
|
||||
void addadjustment(fixed_t value)
|
||||
{
|
||||
if (!SyncInput())
|
||||
{
|
||||
adjustment += value;
|
||||
}
|
||||
else
|
||||
{
|
||||
horiz += q16horiz(value);
|
||||
}
|
||||
}
|
||||
|
||||
void resetadjustment()
|
||||
{
|
||||
adjustment = 0;
|
||||
|
|
|
@ -1167,6 +1167,32 @@ void FuncPlayer(int a, int nDamage, int nRun)
|
|||
}
|
||||
|
||||
sectdone:
|
||||
static bool plrFalling = false;
|
||||
if (!PlayerList[nPlayer].horizon.horiz.asbuild() || plrFalling)
|
||||
{
|
||||
// Calculate base pan amount based on how much the player is falling.
|
||||
fixed_t dVertPan = (spr_z - sprite[nPlayerSprite].z) << 9;
|
||||
if (dVertPan != 0)
|
||||
{
|
||||
fixed_t adjustment;
|
||||
|
||||
if (dVertPan >= IntToFixed(4))
|
||||
adjustment = IntToFixed(4);
|
||||
else if (dVertPan <= -IntToFixed(4))
|
||||
adjustment = -IntToFixed(4);
|
||||
else
|
||||
adjustment = dVertPan << 1;
|
||||
|
||||
PlayerList[nPlayer].horizon.addadjustment(adjustment);
|
||||
plrFalling = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sPlayerInput[nPlayer].actions |= SB_CENTERVIEW;
|
||||
plrFalling = false;
|
||||
}
|
||||
}
|
||||
|
||||
playerX -= sprite[nPlayerSprite].x;
|
||||
playerY -= sprite[nPlayerSprite].y;
|
||||
|
||||
|
|
Loading…
Reference in a new issue