From 759223c59d23b55e8bab4d3e2f5ddc498fb3e956 Mon Sep 17 00:00:00 2001 From: He-Man Date: Wed, 6 Jul 2016 23:01:57 +0200 Subject: [PATCH] Update EPOCH_server_loadTraders.sqf Stored Vehicles was only counted for Static Traders. --- .../epoch_traders/EPOCH_server_loadTraders.sqf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf b/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf index 828030a7..aebd706b 100644 --- a/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf +++ b/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf @@ -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 (EPOCH_storedVehicleCount <= _storedVehicleLimit) then { 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 { _toBeRemoved pushBack _forEachIndex; };