Fix #14277: Aircraft can land when Zeppeliner in the runway (#14317)

This commit is contained in:
Ivan Pravdin
2025-07-16 22:26:57 -07:00
committed by GitHub
parent 55605ae8f2
commit 434163aa31
3 changed files with 20 additions and 5 deletions

View File

@@ -215,7 +215,7 @@ void DisasterVehicle::UpdatePosition(int x, int y, int z)
/**
* Zeppeliner handling, v->state states:
* 0: Zeppeliner initialization has found a small airport, go there and crash
* 0: Zeppeliner initialization has found an airport, go there and crash
* 1: Create crash and animate falling down for extra dramatic effect
* 2: Create more smoke and leave debris on ground
* 2: Clear the runway after some time and remove crashed zeppeliner
@@ -263,7 +263,7 @@ static bool DisasterTick_Zeppeliner(DisasterVehicle *v)
if (IsValidTile(v->tile) && IsAirportTile(v->tile)) {
Station *st = Station::GetByTile(v->tile);
st->airport.blocks.Reset(AirportBlock::RunwayIn);
st->airport.blocks.Reset({AirportBlock::Zeppeliner, AirportBlock::RunwayIn});
AI::NewEvent(GetTileOwner(v->tile), new ScriptEventDisasterZeppelinerCleared(st->index));
}
@@ -300,7 +300,7 @@ static bool DisasterTick_Zeppeliner(DisasterVehicle *v)
}
if (IsValidTile(v->tile) && IsAirportTile(v->tile)) {
Station::GetByTile(v->tile)->airport.blocks.Set(AirportBlock::RunwayIn);
Station::GetByTile(v->tile)->airport.blocks.Reset({AirportBlock::Zeppeliner, AirportBlock::RunwayIn});
}
return true;
@@ -722,14 +722,14 @@ typedef void DisasterInitProc();
/**
* Zeppeliner which crashes on a small airport if one found,
* Zeppeliner which crashes on an airport if one found,
* otherwise crashes on a random tile
*/
static void Disaster_Zeppeliner_Init()
{
if (!Vehicle::CanAllocateItem(2)) return;
/* Pick a random place, unless we find a small airport */
/* Pick a random place, unless we find an airport */
int x = TileX(RandomTile()) * TILE_SIZE + TILE_SIZE / 2;
for (const Station *st : Station::Iterate()) {