allow loot spawner to spawn items not in the cfgprices table

should fix issue with not getting raw meat from gutting animals
This commit is contained in:
vbawol 2016-05-01 14:22:31 -05:00
parent 83a53a5f5b
commit 8dcece4903
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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)};