diff --git a/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf b/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf index 9ca89250..a16ec9ae 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_npcTraderAdd.sqf @@ -14,7 +14,7 @@ */ private [ "_PlayerFilerDropDown","_PlayerItemsBox","_PlayerItemsOutBox","_TraderItemsOutBox","_CryptoInCtrl","_CryptoOutCtrl","_allowAdd","_uiItem","_rounds","_itemIcon","_itemColor","_errormsg","_stockLimit","_config", - "_itemClasses","_itemQtys","_qtyIndex","_limit","_sizeOut","_item","_vehicle","_itemName","_index","_maxrnd","_ItemIndex","_cryptoCount","_worth","_itemTax","_tax" + "_itemClasses","_itemQtys","_qtyIndex","_sizeOut","_item","_vehicle","_itemName","_index","_maxrnd","_ItemIndex","_cryptoCount","_worth","_itemTax","_tax" ]; params ["_control","_selected"]; _selected params ["_CurControl","_id"]; 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 22fd3fdd..37b9bacd 100644 --- a/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf +++ b/Sources/epoch_server/compile/epoch_traders/EPOCH_server_loadTraders.sqf @@ -14,8 +14,8 @@ */ //[[[cog import generate_private_arrays ]]] private [ "_TraderGodMode","_StaticTraderItemPurge","_DynamicTraderRespawnCount","_TraderItemsDeleteRestart","_TraderInit","_TraderItemsClean","_newstock","_agent","_aiTables", - "_arr","_config","_currentStock","_existingStock","_indexStock","_limit","_markers","_objHiveKey","_pos","_randomAIUniform","_response","_response2","_schedule", - "_serverSettingsConfig","_staticTrader","_staticTradersArrCount","_staticTradersArray","_storedVehicleLimit","_traderSlotIndex","_work","_arrchanged","_deleteat" + "_arr","_config","_currentStock","_existingStock","_indexStock","_markers","_objHiveKey","_pos","_randomAIUniform","_response","_response2","_schedule", + "_serverSettingsConfig","_staticTrader","_staticTradersArrCount","_staticTradersArray","_storedVehicleLimit","_traderSlotIndex","_work","_arrchanged","_deleteat","_maxrnd" ]; //[[[end]]] params [["_maxTraderLimit",0]]; @@ -54,6 +54,11 @@ _TraderItemsClean = { _delete = false; _item = _arr select 0 select _idx; _currentStock = (_arr select 1) param[_idx, 0]; + _maxrnd = 1; + if ([_item,"cfgMagazines"] call Epoch_fnc_isAny) then { + _maxrnd = getnumber (configfile >> "cfgMagazines" >> _item >> "count"); + }; + _currentStock = _currentStock / _maxrnd; if (_currentStock >= (_TraderItemCountPerItem select 0)) then { _currentStock = _TraderItemCountPerItem select 1; (_arr select 1) set [_idx,_currentStock];