Merge branch 'master' into jgrpp-beta
# Conflicts: # .github/workflows/commit-checker.yml # src/company_cmd.cpp # src/console_cmds.cpp # src/crashlog.cpp # src/lang/english.txt # src/lang/german.txt # src/lang/indonesian.txt # src/lang/japanese.txt # src/lang/korean.txt # src/lang/swedish.txt # src/linkgraph/linkgraphjob.cpp # src/linkgraph/mcf.cpp # src/network/core/tcp.cpp # src/network/core/tcp.h # src/network/core/tcp_game.h # src/network/core/udp.h # src/network/network.cpp # src/network/network_admin.cpp # src/network/network_admin.h # src/network/network_chat_gui.cpp # src/network/network_client.cpp # src/network/network_client.h # src/network/network_func.h # src/network/network_internal.h # src/network/network_server.cpp # src/network/network_server.h # src/newgrf.cpp # src/newgrf_station.cpp # src/order_gui.cpp # src/rail_cmd.cpp # src/saveload/saveload.cpp # src/settings.cpp # src/settings_gui.cpp # src/settings_internal.h # src/settings_type.h # src/station_cmd.cpp # src/stdafx.h # src/table/currency_settings.ini # src/table/misc_settings.ini # src/table/settings.h.preamble # src/table/settings.ini # src/terraform_cmd.cpp # src/timetable_gui.cpp # src/train_cmd.cpp # src/tree_cmd.cpp # src/water_cmd.cpp
This commit is contained in:
@@ -3339,27 +3339,27 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
* these do not directly have an owner so we need to check adjacent
|
||||
* tiles. This won't work correctly in the same loop if the adjacent
|
||||
* tile was already deleted earlier in the loop. */
|
||||
for (TileIndex tile = 0; tile < MapSize(); ++tile) {
|
||||
if (IsTileType(tile, MP_TUNNELBRIDGE) && TestTownOwnsBridge(tile, t)) {
|
||||
CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
for (TileIndex current_tile = 0; current_tile < MapSize(); ++current_tile) {
|
||||
if (IsTileType(current_tile, MP_TUNNELBRIDGE) && TestTownOwnsBridge(current_tile, t)) {
|
||||
CommandCost ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check all remaining tiles for town ownership. */
|
||||
for (TileIndex tile = 0; tile < MapSize(); ++tile) {
|
||||
for (TileIndex current_tile = 0; current_tile < MapSize(); ++current_tile) {
|
||||
bool try_clear = false;
|
||||
switch (GetTileType(tile)) {
|
||||
switch (GetTileType(current_tile)) {
|
||||
case MP_ROAD:
|
||||
try_clear = HasTownOwnedRoad(tile) && GetTownIndex(tile) == t->index;
|
||||
try_clear = HasTownOwnedRoad(current_tile) && GetTownIndex(current_tile) == t->index;
|
||||
break;
|
||||
|
||||
case MP_HOUSE:
|
||||
try_clear = GetTownIndex(tile) == t->index;
|
||||
try_clear = GetTownIndex(current_tile) == t->index;
|
||||
break;
|
||||
|
||||
case MP_INDUSTRY:
|
||||
try_clear = Industry::GetByTile(tile)->town == t;
|
||||
try_clear = Industry::GetByTile(current_tile)->town == t;
|
||||
break;
|
||||
|
||||
case MP_OBJECT:
|
||||
@@ -3367,7 +3367,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
/* No towns will be left, remove it! */
|
||||
try_clear = true;
|
||||
} else {
|
||||
Object *o = Object::GetByTile(tile);
|
||||
Object *o = Object::GetByTile(current_tile);
|
||||
if (o->town == t) {
|
||||
if (o->type == OBJECT_STATUE) {
|
||||
/* Statue... always remove. */
|
||||
@@ -3384,7 +3384,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
break;
|
||||
}
|
||||
if (try_clear) {
|
||||
CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
CommandCost ret = DoCommand(current_tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user