mirror of https://github.com/OpenRCT2/OpenRCT2.git
Integrate vehicle synchronisation info
This commit is contained in:
parent
2db2ef5eec
commit
6ba62ed123
|
@ -2079,11 +2079,12 @@ typedef struct rct_synchronised_vehicle {
|
|||
assert_struct_size(rct_synchronised_vehicle, 4);
|
||||
#pragma pack(pop)
|
||||
|
||||
// 8 synchronised vehicle info
|
||||
rct_synchronised_vehicle *_synchronisedVehicles = (rct_synchronised_vehicle*)0x00F64E4C;
|
||||
#define SYNCHRONISED_VEHICLE_COUNT 8
|
||||
|
||||
#define _lastSynchronisedVehicle RCT2_GLOBAL(0x00F64E48, rct_synchronised_vehicle*)
|
||||
#define MaxSynchronisedVehicle ((rct_synchronised_vehicle*)0x00F64E6C)
|
||||
// 8 synchronised vehicle info
|
||||
rct_synchronised_vehicle _synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT] = { 0 };
|
||||
|
||||
static rct_synchronised_vehicle* _lastSynchronisedVehicle = NULL;
|
||||
|
||||
/**
|
||||
* Checks if a map position contains a synchronised ride station and adds the vehicle
|
||||
|
@ -2168,7 +2169,7 @@ static bool vehicle_can_depart_synchronised(rct_vehicle *vehicle)
|
|||
int direction = (mapElement->type + 1) & 3;
|
||||
_lastSynchronisedVehicle = _synchronisedVehicles;
|
||||
|
||||
while (_lastSynchronisedVehicle < MaxSynchronisedVehicle) {
|
||||
while (_lastSynchronisedVehicle < &_synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT - 1]) {
|
||||
x += TileDirectionDelta[direction].x;
|
||||
y += TileDirectionDelta[direction].y;
|
||||
if (!try_add_synchronised_station(x, y, z)) {
|
||||
|
@ -2176,7 +2177,7 @@ static bool vehicle_can_depart_synchronised(rct_vehicle *vehicle)
|
|||
}
|
||||
}
|
||||
|
||||
while (_lastSynchronisedVehicle < MaxSynchronisedVehicle) {
|
||||
while (_lastSynchronisedVehicle < &_synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT - 1]) {
|
||||
x += TileDirectionDelta[direction].x;
|
||||
y += TileDirectionDelta[direction].y;
|
||||
if (!try_add_synchronised_station(x, y, z)) {
|
||||
|
|
Loading…
Reference in New Issue