Browse Source

cleanup manual value clamping: cursor.cpp CheckCursMove() (#2563)

pull/2567/head
BC Ko 5 years ago committed by GitHub
parent
commit
b1d9bfdbf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      Source/cursor.cpp

14
Source/cursor.cpp

@ -360,18 +360,8 @@ void CheckCursMove()
mx++;
}
if (mx < 0) {
mx = 0;
}
if (mx >= MAXDUNX) {
mx = MAXDUNX - 1;
}
if (my < 0) {
my = 0;
}
if (my >= MAXDUNY) {
my = MAXDUNY - 1;
}
mx = clamp(mx, 0, MAXDUNX - 1);
my = clamp(my, 0, MAXDUNY - 1);
// While holding the button down we should retain target (but potentially lose it if it dies, goes out of view, etc)
if (sgbMouseDown != CLICK_NONE && pcursinvitem == -1) {

Loading…
Cancel
Save