mirror of https://github.com/OpenTTD/OpenTTD
(svn r19331) -Fix: when deleting an airport the size from the AirportSpec was used instead of the stored airport size
-Fix (r19319): detecting if a plane was landed at an airport failed -Fix: reset the airporttile mapping when restarting a gamerelease/1.1
parent
46d5ef925b
commit
1eb52326cf
|
@ -15,7 +15,6 @@
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "newgrf_commons.h"
|
#include "newgrf_commons.h"
|
||||||
#include "airport.h"
|
|
||||||
|
|
||||||
/** Animation triggers for airport tiles */
|
/** Animation triggers for airport tiles */
|
||||||
enum AirpAnimationTrigger {
|
enum AirpAnimationTrigger {
|
||||||
|
|
|
@ -313,6 +313,7 @@ static void InitializeDynamicVariables()
|
||||||
_house_mngr.ResetMapping();
|
_house_mngr.ResetMapping();
|
||||||
_industry_mngr.ResetMapping();
|
_industry_mngr.ResetMapping();
|
||||||
_industile_mngr.ResetMapping();
|
_industile_mngr.ResetMapping();
|
||||||
|
_airporttile_mngr.ResetMapping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2229,10 +2229,6 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||||
|
|
||||||
tile = st->airport.tile;
|
tile = st->airport.tile;
|
||||||
|
|
||||||
const AirportSpec *as = st->GetAirportSpec();
|
|
||||||
int w = as->size_x;
|
|
||||||
int h = as->size_y;
|
|
||||||
|
|
||||||
CommandCost cost(EXPENSES_CONSTRUCTION);
|
CommandCost cost(EXPENSES_CONSTRUCTION);
|
||||||
|
|
||||||
const Aircraft *a;
|
const Aircraft *a;
|
||||||
|
@ -2244,7 +2240,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||||
TILE_AREA_LOOP(tile_cur, st->airport) {
|
TILE_AREA_LOOP(tile_cur, st->airport) {
|
||||||
if (!st->TileBelongsToAirport(tile_cur)) continue;
|
if (!st->TileBelongsToAirport(tile_cur)) continue;
|
||||||
|
|
||||||
CommandCost ret = EnsureNoVehicleOnGround(tile);
|
CommandCost ret = EnsureNoVehicleOnGround(tile_cur);
|
||||||
ret.SetGlobalErrorMessage();
|
ret.SetGlobalErrorMessage();
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
|
||||||
|
@ -2257,6 +2253,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
const AirportSpec *as = st->GetAirportSpec();
|
||||||
for (uint i = 0; i < as->nof_depots; ++i) {
|
for (uint i = 0; i < as->nof_depots; ++i) {
|
||||||
DeleteWindowById(
|
DeleteWindowById(
|
||||||
WC_VEHICLE_DEPOT, st->GetHangarTile(i)
|
WC_VEHICLE_DEPOT, st->GetHangarTile(i)
|
||||||
|
@ -2269,7 +2266,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
|
||||||
Town *nearest = AirportGetNearestTown(as, tile);
|
Town *nearest = AirportGetNearestTown(as, tile);
|
||||||
nearest->noise_reached -= GetAirportNoiseLevelForTown(as, nearest->xy, tile);
|
nearest->noise_reached -= GetAirportNoiseLevelForTown(as, nearest->xy, tile);
|
||||||
|
|
||||||
st->rect.AfterRemoveRect(st, tile, w, h);
|
st->rect.AfterRemoveRect(st, tile, st->airport.w, st->airport.h);
|
||||||
|
|
||||||
st->airport.Clear();
|
st->airport.Clear();
|
||||||
st->facilities &= ~FACIL_AIRPORT;
|
st->facilities &= ~FACIL_AIRPORT;
|
||||||
|
|
Loading…
Reference in New Issue