Browse Source

Cursor: Always use result of CalcTileOffset (#5221)

pull/5225/head
obligaron 4 years ago committed by GitHub
parent
commit
04287fc4d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      Source/cursor.cpp

7
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<int16_t> offset2 = myPlayer.position.CalculateWalkingOffsetShifted8(myPlayer._pdir, myPlayer.AnimInfo);

Loading…
Cancel
Save