projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4dda9ec
)
code cleanup (no functional change)
author
Holger Schemel
<info@artsoft.org>
Mon, 3 Apr 2023 09:06:02 +0000
(11:06 +0200)
committer
Holger Schemel
<info@artsoft.org>
Mon, 3 Apr 2023 09:06:28 +0000
(11:06 +0200)
src/events.c
patch
|
blob
|
history
diff --git
a/src/events.c
b/src/events.c
index 985dc2a2e2e84f775fbbf2e2e3a650a6c179fa6d..2810e84f11643b1cb09a99bde0faf69efb90dafc 100644
(file)
--- a/
src/events.c
+++ b/
src/events.c
@@
-2553,14
+2553,14
@@
static void HandleTileCursor(int dx, int dy, int button)
{
int old_xpos = tile_cursor.xpos;
int old_ypos = tile_cursor.ypos;
{
int old_xpos = tile_cursor.xpos;
int old_ypos = tile_cursor.ypos;
- int new_xpos =
old_xpos
;
- int new_ypos =
old_ypos
;
+ int new_xpos =
tile_cursor.xpos + dx
;
+ int new_ypos =
tile_cursor.ypos + dy
;
- if (
IN_LEV_FIELD(old_xpos + dx
, old_ypos))
- new_xpos = old_xpos
+ dx
;
+ if (
!IN_LEV_FIELD(new_xpos
, old_ypos))
+ new_xpos = old_xpos;
- if (
IN_LEV_FIELD(old_xpos, old_ypos + dy
))
- new_ypos = old_ypos
+ dy
;
+ if (
!IN_LEV_FIELD(old_xpos, new_ypos
))
+ new_ypos = old_ypos;
SetTileCursorTargetXY(new_xpos, new_ypos);
}
SetTileCursorTargetXY(new_xpos, new_ypos);
}