From 3b3e926fd36f36c36f77119eb184cd8c5f762f9b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 22 Nov 2020 20:54:59 +1100 Subject: [PATCH] - gameinput.h: For `PlayerAngle` struct, add int `settarget()` overload and change one true call with a float to `bvectangf()`. --- source/core/gameinput.h | 14 ++++++++++++++ source/sw/src/player.cpp | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/source/core/gameinput.h b/source/core/gameinput.h index c868aa25c..86b9d1dfd 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -167,6 +167,20 @@ struct PlayerAngle adjustment = 0; } + void settarget(int value, bool backup = false) + { + if (!cl_syncinput) + { + target = value << BAMBITS; + if (target == 0) target += 1; + } + else + { + ang = buildang(value); + if (backup) oang = ang; + } + } + void settarget(double value, bool backup = false) { if (!cl_syncinput) diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 6b28928bd..a912a25aa 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -7223,7 +7223,7 @@ domovethings(void) // auto tracking mode for single player multi-game if (numplayers <= 1 && PlayerTrackingMode && pnum == screenpeek && screenpeek != myconnectindex) { - Player[screenpeek].angle.settarget(FixedToFloat(gethiq16angle(Player[myconnectindex].posx - Player[screenpeek].posx, Player[myconnectindex].posy - Player[screenpeek].posy))); + Player[screenpeek].angle.settarget(bvectangf(Player[myconnectindex].posx - Player[screenpeek].posx, Player[myconnectindex].posy - Player[screenpeek].posy)); } if (!TEST(pp->Flags, PF_DEAD))