From 2865fef7ed55be6ad9b6682d2f32f8e942fd9154 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 10 Oct 2020 16:59:00 +1100 Subject: [PATCH] - Duke: Restore `return_to_center` in gameexec.cpp dropped in 0ab3b33a6c1ee98b8d28369a824be0dfa0950003 and redo based on new code. --- source/games/duke/src/gameexec.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 8a41d244b..1fb845c9b 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -909,6 +909,18 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, int sActor, int sPl else SetGameVarID((int)lVar2, ps[iPlayer].actors_killed, sActor, sPlayer); break; + case PLAYER_RETURN_TO_CENTER: + if (bSet) + { + ps[iPlayer].sync.actions |= SB_CENTERVIEW; + } + else + { + auto center = ps[iPlayer].sync.actions & SB_CENTERVIEW ? xs_CRoundToInt(ps[iPlayer].horizon.horiz.asbuild() * (9. / gi->playerHorizMax())) : 0; + SetGameVarID((int)lVar2, center, sActor, sPlayer); + } + break; + default: if (!bSet) SetGameVarID((int)lVar2, 0, sActor, sPlayer); break;