From 8dcece490312b378fbbeda1db9ecec9cd0db1a13 Mon Sep 17 00:00:00 2001 From: vbawol Date: Sun, 1 May 2016 14:22:31 -0500 Subject: [PATCH] allow loot spawner to spawn items not in the cfgprices table should fix issue with not getting raw meat from gutting animals --- .../compile/epoch_looting/EPOCH_server_lootAnimal.sqf | 2 +- .../compile/epoch_server/EPOCH_serverLootObject.sqf | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootAnimal.sqf b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootAnimal.sqf index 492467ac..19dc513d 100644 --- a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootAnimal.sqf +++ b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootAnimal.sqf @@ -30,6 +30,6 @@ if !(isNull _object) then { if (isClass(_config)) then { _class = _objectClass; }; - [_item, _class] call EPOCH_serverLootObject; + [_item, _class, true] call EPOCH_serverLootObject; }; true diff --git a/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf b/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf index f7a9bdfe..2471aa36 100644 --- a/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf +++ b/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf @@ -13,7 +13,7 @@ https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf */ private["_randomItemArray", "_quan", "_randomLootClass", "_randomItem", "_lootPaid", "_mags", "_lootItemWeightedArray", "_lootItemArray", "_weightedItemArray", "_exit", "_maxPayout", "_lootTable", "_lootTableArray", "_weightedArray"]; -params ["_object","_type"]; +params ["_object","_type",["_forceSpawn",false]]; _debug = true; _pricingConfig = 'CfgPricing' call EPOCH_returnConfig; _lootTableClass = ["CfgLootTable","CfgLootTable_CUP"] select EPOCH_modCUPWeaponsEnabled; @@ -44,7 +44,7 @@ if !(isNull _object) then{ while {_loop} do { switch _type do { case "item": { - if (isClass (_pricingConfig >> _randomItem)) then { + if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then { _object additemCargoGlobal [_randomItem, _quan]; } else { if (_debug) then {diag_log format["DEBUG: suppress spawn of %1 does not have price.",_randomItem]}; @@ -52,7 +52,7 @@ if !(isNull _object) then{ _loop = false; }; case "magazine": { - if (isClass (_pricingConfig >> _randomItem)) then { + if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then { if (_randomizeMagazineAmmoCount) then { // spawn a single Magazine with a random ammo count _magazineSize = getNumber (configFile >> "CfgMagazines" >> _randomItem >> "count"); @@ -67,7 +67,7 @@ if !(isNull _object) then{ _loop = false; }; case "backpack": { - if (isClass (_pricingConfig >> _randomItem)) then { + if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then { _object addBackpackCargoGlobal [_randomItem, _quan]; } else { if (_debug) then {diag_log format["DEBUG: suppress spawn of %1 does not have price.",_randomItem]}; @@ -75,7 +75,7 @@ if !(isNull _object) then{ _loop = false; }; case "weapon": { - if (isClass (_pricingConfig >> _randomItem)) then { + if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then { _object addWeaponCargoGlobal [_randomItem, _quan]; // only spawn mags that have prices _mags = getArray (configFile >> "CfgWeapons" >> _randomItem >> "magazines") select {isClass (_pricingConfig >> _x)};