(svn r10172) -Fix(r10127): Wrong evaluation order on variable 0x41 for industry tile.
authorbelugas
Sun, 17 Jun 2007 01:01:15 +0000
changeset 6919 4f62b4f5a81f
parent 6918 43b7ded86b20
child 6920 04eb2d52f87f
(svn r10172) -Fix(r10127): Wrong evaluation order on variable 0x41 for industry tile.
The industry's xy (northernmost tile) should be checked against the relative tile, not the other way around.
src/newgrf_industrytiles.cpp
--- a/src/newgrf_industrytiles.cpp	Sat Jun 16 21:57:30 2007 +0000
+++ b/src/newgrf_industrytiles.cpp	Sun Jun 17 01:01:15 2007 +0000
@@ -51,8 +51,8 @@
  */
 static uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile)
 {
-	byte x = TileX(ind_tile) - TileX(tile);
-	byte y = TileY(ind_tile) - TileY(tile);
+	byte x = TileX(tile) - TileX(ind_tile);
+	byte y = TileY(tile) - TileY(ind_tile);
 
 	return ((y & 0xF) << 20) | ((x & 0xF) << 16) | (y << 8) | x;
 }