Fix #8797: Use logical rail length when placing signals (#9652)

This commit is contained in:
dP
2021-11-19 03:07:22 +03:00
committed by GitHub
parent 2cb6351af5
commit 54951e39a1
2 changed files with 109 additions and 76 deletions

View File

@@ -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;
}
/**