From 5f4f78574f10b7727ad5aad3d8e3f25b48904b87 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 3 Feb 2025 12:51:06 +0000 Subject: [PATCH] Codefix: Town index used in CMD_BUILD_ROAD test call in IsRoadAllowedHere (#13451) --- 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; }