1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix #2235 anti clockwise no longer crashes

Issue cause by %4 not handling negative numbers.
This commit is contained in:
duncanspumpkin
2015-11-08 09:22:29 +00:00
parent d1c597aaa0
commit 251ee91bf6

View File

@@ -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);