summaryrefslogtreecommitdiff
path: root/sim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sim.cpp')
-rw-r--r--sim.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/sim.cpp b/sim.cpp
index 395951c..824a7c5 100644
--- a/sim.cpp
+++ b/sim.cpp
@@ -685,9 +685,13 @@ void sim_frame(Frame *frame) {
if (keys_pressed[KEY_R]) {
// toggle rotating platform
- platform_building->rotates = !platform_building->rotates;
- if (platform_building->rotate_speed == 0) {
- platform_building->rotate_speed = 1;
+ bool rotates = platform_building->rotates = !platform_building->rotates;
+ if (rotates) {
+ if (platform_building->rotate_speed == 0) {
+ platform_building->rotate_speed = 1;
+ }
+ } else {
+ platform_building->rotate_speed = 0;
}
}