From 251ee91bf671af1d82eea77ed2867c50fb9491a5 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 8 Nov 2015 09:22:29 +0000 Subject: [PATCH] Fix #2235 anti clockwise no longer crashes Issue cause by %4 not handling negative numbers. --- src/interface/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface/window.c b/src/interface/window.c index 90865813d7..8a4ad7831a 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -1389,7 +1389,7 @@ void window_rotate_camera(rct_window *w, int direction) z = map_element_height(x, y); } - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32) = (get_current_rotation() + direction) % 4; + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32) = (get_current_rotation() + direction) & 3; int new_x, new_y; center_2d_coordinates(x, y, z, &new_x, &new_y, viewport);