@@ -2869,14 +2869,13 @@ CommandCost CmdDeleteTown(TileIndex tile
{
if (_game_mode != GM_EDITOR && !_generating_world) return CMD_ERROR;
Town *t = Town::GetIfValid(p1);
if (t == nullptr) return CMD_ERROR;
/* Stations refer to towns. */
const Station *st;
FOR_ALL_STATIONS(st) {
for (const Station *st : Station::Iterate()) {
if (st->town == t) {
/* Non-oil rig stations are always a problem. */
if (!(st->facilities & FACIL_AIRPORT) || st->airport.type != AT_OILRIG) return CMD_ERROR;
/* We can only automatically delete oil rigs *if* there's no vehicle on them. */
CommandCost ret = DoCommand(st->airport.tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
@@ -3156,14 +3155,13 @@ static CommandCost TownActionBribe(Town
if (flags & DC_EXEC) {
if (Chance16(1, 14)) {
/* set as unwanted for 6 months */
t->unwanted[_current_company] = 6;
/* set all close by station ratings to 0 */
Station *st;
for (Station *st : Station::Iterate()) {
if (st->town == t && st->owner == _current_company) {
for (CargoID i = 0; i < NUM_CARGO; i++) st->goods[i].rating = 0;
}
/* only show error message to the executing player. All errors are handled command.c