src/water_cmd.cpp
changeset 8510 17bda703ae17
parent 8473 773b817b64d0
child 8518 08fc9e9bbddd
equal deleted inserted replaced
8509:f7f6bccde48f 8510:17bda703ae17
   662 
   662 
   663 		/* No vehicle could be flooded on this airport anymore */
   663 		/* No vehicle could be flooded on this airport anymore */
   664 		return NULL;
   664 		return NULL;
   665 	}
   665 	}
   666 
   666 
       
   667 	/* if non-uniform stations are disabled, flood some train in this train station (if there is any) */
       
   668 	if (!_patches.nonuniform_stations && IsTileType(tile, MP_STATION) && GetStationType(tile) == STATION_RAIL) {
       
   669 		const Station *st = GetStationByTile(tile);
       
   670 
       
   671 		BEGIN_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
       
   672 			if (st->TileBelongsToRailStation(t)) {
       
   673 				Vehicle *v = FindVehicleOnTileZ(t, 0);
       
   674 				if (v != NULL && (v->vehstatus & VS_CRASHED) == 0) return v;
       
   675 			}
       
   676 		END_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
       
   677 
       
   678 		return NULL;
       
   679 	}
       
   680 
   667 	if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0);
   681 	if (!IsBridgeTile(tile)) return FindVehicleOnTileZ(tile, 0);
   668 
   682 
   669 	TileIndex end = GetOtherBridgeEnd(tile);
   683 	TileIndex end = GetOtherBridgeEnd(tile);
   670 	byte z = GetBridgeHeight(tile);
   684 	byte z = GetBridgeHeight(tile);
   671 	Vehicle *v;
   685 	Vehicle *v;