summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorExpoSeed <unknown>2021-05-07 13:50:50 -0500
committerhuderlem <huderlem@gmail.com>2021-05-11 10:12:01 -0500
commit43854664b51c94e8cb73a535dd176311208486e8 (patch)
tree145a9dda855428fccaa9b0118410bcf734373efe /src
parent40c13e97e7210fa01d8fc52321d21f057d342f8f (diff)
Fix UB in RotatingGate_RotateInDirection
Diffstat (limited to 'src')
-rw-r--r--src/rotating_gate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rotating_gate.c b/src/rotating_gate.c
index 22a0b0bdf..36c23c2a5 100644
--- a/src/rotating_gate.c
+++ b/src/rotating_gate.c
@@ -670,7 +670,8 @@ static void RotatingGate_RotateInDirection(u8 gateId, u32 rotationDirection)
}
else
{
- orientation = ++orientation % GATE_ORIENTATION_MAX;
+ orientation++;
+ orientation = orientation % GATE_ORIENTATION_MAX;
}
RotatingGate_SetGateOrientation(gateId, orientation);
}