From 2978816c2d1c3fdd5aa6ffcaf1fc9e72261b371f Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 2 Feb 2025 18:52:10 +0000 Subject: [PATCH] Codefix: Town index used in CMD_BUILD_ROAD test call in IsRoadAllowedHere --- src/town_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index ac93a538ef..b02ae53c04 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1084,7 +1084,7 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir) * If that fails clear the land, and if that fails exit. * This is to make sure that we can build a road here later. */ RoadType rt = GetTownRoadType(); - if (Command::Do(DC_AUTO | DC_NO_WATER, tile, (dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X, rt, DRD_NONE, INVALID_TOWN).Failed() && + if (Command::Do(DC_AUTO | DC_NO_WATER, tile, (dir == DIAGDIR_NW || dir == DIAGDIR_SE) ? ROAD_Y : ROAD_X, rt, DRD_NONE, t->index).Failed() && Command::Do(DC_AUTO | DC_NO_WATER, tile).Failed()) { return false; }