Allow building multiple docks per station.
(cherry picked from commit 0110c4a35d383e0be2cbb53cbe9cbe6784abb3e9) # Conflicts: # src/station_cmd.cpp
This commit is contained in:

committed by
Jonathan G Rennison

parent
d486d58d86
commit
1d3cf59d8a
@@ -30,6 +30,7 @@
|
||||
#include "../station_base.h"
|
||||
#include "../waypoint_base.h"
|
||||
#include "../roadstop_base.h"
|
||||
#include "../dock_base.h"
|
||||
#include "../tunnelbridge_map.h"
|
||||
#include "../pathfinder/yapf/yapf_cache.h"
|
||||
#include "../elrail_func.h"
|
||||
@@ -728,9 +729,9 @@ bool AfterLoadGame()
|
||||
/* no station is determined by 'tile == INVALID_TILE' now (instead of '0') */
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
if (st->airport.tile == 0) st->airport.tile = INVALID_TILE;
|
||||
if (st->dock_tile == 0) st->dock_tile = INVALID_TILE;
|
||||
if (st->train_station.tile == 0) st->train_station.tile = INVALID_TILE;
|
||||
if (st->airport.tile == 0) st->airport.tile = INVALID_TILE;
|
||||
if (st->dock_station.tile == 0) st->dock_station.tile = INVALID_TILE;
|
||||
if (st->train_station.tile == 0) st->train_station.tile = INVALID_TILE;
|
||||
}
|
||||
|
||||
/* the same applies to Company::location_of_HQ */
|
||||
@@ -3343,6 +3344,21 @@ bool AfterLoadGame()
|
||||
FOR_ALL_STATIONS(st) UpdateStationAcceptance(st, false);
|
||||
}
|
||||
|
||||
if (IsPatchPackSavegameVersionBefore(SL_PATCH_PACK_1_18)) {
|
||||
/* Dock type has changed. */
|
||||
Station *st;
|
||||
FOR_ALL_STATIONS(st) {
|
||||
if (st->dock_station.tile == INVALID_TILE) continue;
|
||||
assert(Dock::CanAllocateItem());
|
||||
if (IsOilRig(st->dock_station.tile)) {
|
||||
/* Set dock station tile to dest tile instead of station. */
|
||||
st->docks = new Dock(st->dock_station.tile, st->dock_station.tile + ToTileIndexDiff({1, 0}));
|
||||
} else { /* A normal two-tiles dock. */
|
||||
st->docks = new Dock(st->dock_station.tile, TileAddByDiagDir(st->dock_station.tile, GetDockDirection(st->dock_station.tile)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// setting moved from game settings to company settings
|
||||
if (SlXvIsFeaturePresent(XSLFI_ORDER_OCCUPANCY, 1, 1)) {
|
||||
Company *c;
|
||||
|
Reference in New Issue
Block a user