From e57d6f8785593d7b61022085959889aef970c4ff Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 22 Nov 2020 23:57:35 +1100 Subject: [PATCH] - Duke: Fix crane's angle `settarget()` call. * Fixes #185. --- source/core/gameinput.h | 14 ++++++++++++++ source/games/duke/src/actors.cpp | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 86b9d1dfd..e3b65524b 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -195,6 +195,20 @@ struct PlayerAngle } } + void settarget(binangle value, bool backup = false) + { + if (!cl_syncinput) + { + target = value.asbam(); + if (target == 0) target += 1; + } + else + { + ang = value; + if (backup) oang = ang; + } + } + void processhelpers(double const scaleAdjust) { if (target) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index e6bb8f7fc..2b1d7f559 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -730,7 +730,8 @@ void movecrane(DDukeActor *actor, int crane) actor->SetActiveCrane(true); ps[p].on_crane = actor; S_PlayActorSound(isRR() ? 390 : DUKE_GRUNT, ps[p].GetActor()); - ps[p].angle.settarget(spri->ang + 1024); + auto ang = ps[p].angle.ang; + ps[p].angle.settarget(ang + getincanglebam(ang, buildang(spri->ang + 1024))); } else {