Skip to content

Commit

Permalink
- Duke: DoPlayer(): Ensure SB_CENTERVIEW bit is cleared when sett…
Browse files Browse the repository at this point in the history
…ing a horiz target from CON.

* Repairs horizon issues raised in https://forum.zdoom.org/viewtopic.php?f=340&p=1185365.
  • Loading branch information
mjr4077au committed Mar 31, 2021
1 parent bf2d807 commit 1688689
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions source/games/duke/src/gameexec.cpp
Expand Up @@ -332,12 +332,19 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;

case PLAYER_HORIZ:
if (bSet) ps[iPlayer].horizon.settarget(lValue - 100);
else SetGameVarID((int)lVar2, ps[iPlayer].horizon.horiz.asbuild() + 100, sActor, sPlayer);
if (bSet)
{
if (ps[iPlayer].sync.actions & SB_CENTERVIEW)
{
ps[iPlayer].sync.actions &= ~SB_CENTERVIEW;
}
ps[iPlayer].horizon.settarget(lValue);
}
else SetGameVarID((int)lVar2, ps[iPlayer].horizon.horiz.asbuild(), sActor, sPlayer);
break;

case PLAYER_OHORIZ:
if (!bSet) SetGameVarID((int)lVar2, ps[iPlayer].horizon.ohoriz.asbuild() + 100, sActor, sPlayer);
if (!bSet) SetGameVarID((int)lVar2, ps[iPlayer].horizon.ohoriz.asbuild(), sActor, sPlayer);
break;

case PLAYER_HORIZOFF:
Expand Down

0 comments on commit 1688689

Please sign in to comment.