From 341bdabc709d5103cdf9c7031d3b7aa9c79e86cc Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 17 Jan 2024 13:23:55 +0000 Subject: [PATCH] Fix #11815, bb491127: Missing brackets prevented vehicles turning properly. (#11816) --- src/direction_func.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/direction_func.h b/src/direction_func.h index 396943b024..c554873a0d 100644 --- a/src/direction_func.h +++ b/src/direction_func.h @@ -71,7 +71,7 @@ inline DirDiff DirDifference(Direction d0, Direction d1) assert(IsValidDirection(d1)); /* Cast to uint so compiler can use bitmask. If the difference is negative * and we used int instead of uint, further "+ 8" would have to be added. */ - return static_cast(static_cast(d0) - static_cast(d1) % 8); + return static_cast((static_cast(d0) - static_cast(d1)) % 8); } /**