mirror of https://github.com/OpenTTD/OpenTTD
Change: Flood trains inside a train depot platform.
parent
c8dfc18380
commit
e26d14c5ef
|
@ -40,6 +40,9 @@
|
|||
#include "water_cmd.h"
|
||||
#include "landscape_cmd.h"
|
||||
#include "pathfinder/water_regions.h"
|
||||
#include "train.h"
|
||||
#include "platform_func.h"
|
||||
#include "pbs.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
|
@ -1073,16 +1076,25 @@ static void FloodVehicles(TileIndex tile)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!IsBridgeTile(tile)) {
|
||||
FindVehicleOnPos(tile, &z, &FloodVehicleProc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsBridgeTile(tile)) {
|
||||
TileIndex end = GetOtherBridgeEnd(tile);
|
||||
z = GetBridgePixelHeight(tile);
|
||||
|
||||
FindVehicleOnPos(tile, &z, &FloodVehicleProc);
|
||||
FindVehicleOnPos(end, &z, &FloodVehicleProc);
|
||||
} else if (IsExtendedRailDepotTile(tile)) {
|
||||
/* Free reserved path. */
|
||||
if (HasDepotReservation(tile)) {
|
||||
Train *v = GetTrainForReservation(tile, GetRailDepotTrack(tile));
|
||||
if (v != nullptr) FreeTrainTrackReservation(v);
|
||||
}
|
||||
/* Crash trains on platform. */
|
||||
for (TileIndex t : GetPlatformTileArea(tile)) {
|
||||
FindVehicleOnPos(t, &z, &FloodVehicleProc);
|
||||
}
|
||||
} else {
|
||||
FindVehicleOnPos(tile, &z, &FloodVehicleProc);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue