mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Merge pull request #565 from Nullimeyer/patch-1
Update EPOCH_server_loadTraders.sqf
This commit is contained in:
commit
415d9d7157
@ -189,6 +189,18 @@ for "_i" from 0 to _maxTraderLimit do {
|
|||||||
if (_x isKindOf "Air" || _x isKindOf "Ship" || _x isKindOf "LandVehicle" || _x isKindOf "Tank") then {
|
if (_x isKindOf "Air" || _x isKindOf "Ship" || _x isKindOf "LandVehicle" || _x isKindOf "Tank") then {
|
||||||
if (EPOCH_storedVehicleCount <= _storedVehicleLimit) then {
|
if (EPOCH_storedVehicleCount <= _storedVehicleLimit) then {
|
||||||
EPOCH_storedVehicleCount = EPOCH_storedVehicleCount + _currentStock;
|
EPOCH_storedVehicleCount = EPOCH_storedVehicleCount + _currentStock;
|
||||||
|
|
||||||
|
// Count how many of this vehicle are in stock at any trader.
|
||||||
|
if !(_x in EPOCH_traderStoredVehicles) then {
|
||||||
|
EPOCH_traderStoredVehicles pushBack _x;
|
||||||
|
EPOCH_traderStoredVehiclesCnt pushBack _currentStock;
|
||||||
|
} else {
|
||||||
|
_indexStock = EPOCH_traderStoredVehicles find _x;
|
||||||
|
if (_indexStock != -1) then {
|
||||||
|
_existingStock = EPOCH_traderStoredVehiclesCnt select _indexStock;
|
||||||
|
EPOCH_traderStoredVehiclesCnt set [_indexStock, (_existingStock + _currentStock)];
|
||||||
|
};
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
_toBeRemoved pushBack _forEachIndex;
|
_toBeRemoved pushBack _forEachIndex;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user