summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authordP <dp@dpointer.org>2021-11-19 03:07:22 +0300
committerGitHub <noreply@github.com>2021-11-19 00:07:22 +0000
commit54951e39a1f0395438180ba920aad88eea928f50 (patch)
tree8cd235808025ccd6d6fa7878dff4cbb1d03a0f8f /src/vehicle_base.h
parent2cb6351af596178ac3169baeffbc5a827f9aad5f (diff)
downloadopenttd-54951e39a1f0395438180ba920aad88eea928f50.tar.xz
Fix #8797: Use logical rail length when placing signals (#9652)
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index 12acaa8ed..a5ab42989 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -26,6 +26,9 @@
#include <list>
#include <map>
+const uint TILE_AXIAL_DISTANCE = 192; // Logical length of the tile in any DiagDirection used in vehicle movement.
+const uint TILE_CORNER_DISTANCE = 128; // Logical length of the tile corner crossing in any non-diagonal direction used in vehicle movement.
+
/** Vehicle status bits in #Vehicle::vehstatus. */
enum VehStatus {
VS_HIDDEN = 0x01, ///< Vehicle is not visible.
@@ -426,7 +429,7 @@ public:
*/
inline uint GetAdvanceDistance()
{
- return (this->direction & 1) ? 192 : 256;
+ return (this->direction & 1) ? TILE_AXIAL_DISTANCE : TILE_CORNER_DISTANCE * 2;
}
/**