- Duke: DoPlayer(): Ensure SB_CENTERVIEW bit is cleared when setting a horiz target from CON.

* Repairs horizon issues raised in https://forum.zdoom.org/viewtopic.php?f=340&p=1185365.
This commit is contained in:
Mitchell Richters 2021-03-31 19:48:38 +11:00
parent bf2d8078a4
commit 16886895b0

View file

@ -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: