From 04287fc4d24c373bf2a6469b95b9841af35c69c2 Mon Sep 17 00:00:00 2001 From: obligaron Date: Mon, 8 Aug 2022 21:12:07 +0200 Subject: [PATCH] Cursor: Always use result of CalcTileOffset (#5221) --- Source/cursor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 7f911750f..6bf47fe9d 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -287,12 +287,15 @@ void CheckCursMove() int xo = 0; int yo = 0; CalcTileOffset(&xo, &yo); + sx += xo; + sy += yo; + const Player &myPlayer = *MyPlayer; if (myPlayer.IsWalking()) { Displacement offset = GetOffsetForWalking(myPlayer.AnimInfo, myPlayer._pdir, true); - sx -= offset.deltaX - xo; - sy -= offset.deltaY - yo; + sx -= offset.deltaX; + sy -= offset.deltaY; // Predict the next frame when walking to avoid input jitter DisplacementOf offset2 = myPlayer.position.CalculateWalkingOffsetShifted8(myPlayer._pdir, myPlayer.AnimInfo);