From 1cf3a2a7265a100ea81d1cc31219d4743a55d938 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 23 Dec 2024 19:08:03 +0000 Subject: [PATCH] Codechange: No need to call DeleteAnimatedTile and DoClearSquare. (#13191) DoClearSquare calls DeleteAnimatedTile itself so this is effectively a duplicate call. --- src/station_cmd.cpp | 6 +----- src/town_cmd.cpp | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 38373f38e9..d525b0ad79 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2196,8 +2196,6 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int repla Company::Get(st->owner)->infrastructure.station--; DirtyCompanyInfrastructureWindows(st->owner); - DeleteAnimatedTile(tile); - uint specindex = GetCustomRoadStopSpecIndex(tile); DeleteNewGRFInspectWindow(GSF_ROADSTOPS, tile.base()); @@ -2205,6 +2203,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int repla if (IsDriveThroughStopTile(tile)) { /* Clears the tile for us */ cur_stop->ClearDriveThrough(); + DeleteAnimatedTile(tile); } else { DoClearSquare(tile); } @@ -2279,8 +2278,6 @@ CommandCost RemoveRoadWaypointStop(TileIndex tile, DoCommandFlag flags, int repl Company::Get(wp->owner)->infrastructure.station--; DirtyCompanyInfrastructureWindows(wp->owner); - DeleteAnimatedTile(tile); - uint specindex = GetCustomRoadStopSpecIndex(tile); DeleteNewGRFInspectWindow(GSF_ROADSTOPS, tile.base()); @@ -2702,7 +2699,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags) cost.AddCost(_price[PR_CLEAR_STATION_AIRPORT]); if (flags & DC_EXEC) { - DeleteAnimatedTile(tile_cur); DoClearSquare(tile_cur); DeleteNewGRFInspectWindow(GSF_AIRPORTTILES, tile_cur.base()); } diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 7bd653abe4..848cc13aee 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2936,7 +2936,6 @@ static void DoClearTownHouseHelper(TileIndex tile, Town *t, HouseID house) assert(IsTileType(tile, MP_HOUSE)); DecreaseBuildingCount(t, house); DoClearSquare(tile); - DeleteAnimatedTile(tile); DeleteNewGRFInspectWindow(GSF_HOUSES, tile.base()); }