mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
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:
parent
83a53a5f5b
commit
8dcece4903
@ -30,6 +30,6 @@ if !(isNull _object) then {
|
|||||||
if (isClass(_config)) then {
|
if (isClass(_config)) then {
|
||||||
_class = _objectClass;
|
_class = _objectClass;
|
||||||
};
|
};
|
||||||
[_item, _class] call EPOCH_serverLootObject;
|
[_item, _class, true] call EPOCH_serverLootObject;
|
||||||
};
|
};
|
||||||
true
|
true
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_server/compile/epoch_server/EPOCH_serverLootObject.sqf
|
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"];
|
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;
|
_debug = true;
|
||||||
_pricingConfig = 'CfgPricing' call EPOCH_returnConfig;
|
_pricingConfig = 'CfgPricing' call EPOCH_returnConfig;
|
||||||
_lootTableClass = ["CfgLootTable","CfgLootTable_CUP"] select EPOCH_modCUPWeaponsEnabled;
|
_lootTableClass = ["CfgLootTable","CfgLootTable_CUP"] select EPOCH_modCUPWeaponsEnabled;
|
||||||
@ -44,7 +44,7 @@ if !(isNull _object) then{
|
|||||||
while {_loop} do {
|
while {_loop} do {
|
||||||
switch _type do {
|
switch _type do {
|
||||||
case "item": {
|
case "item": {
|
||||||
if (isClass (_pricingConfig >> _randomItem)) then {
|
if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then {
|
||||||
_object additemCargoGlobal [_randomItem, _quan];
|
_object additemCargoGlobal [_randomItem, _quan];
|
||||||
} else {
|
} else {
|
||||||
if (_debug) then {diag_log format["DEBUG: suppress spawn of %1 does not have price.",_randomItem]};
|
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;
|
_loop = false;
|
||||||
};
|
};
|
||||||
case "magazine": {
|
case "magazine": {
|
||||||
if (isClass (_pricingConfig >> _randomItem)) then {
|
if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then {
|
||||||
if (_randomizeMagazineAmmoCount) then {
|
if (_randomizeMagazineAmmoCount) then {
|
||||||
// spawn a single Magazine with a random ammo count
|
// spawn a single Magazine with a random ammo count
|
||||||
_magazineSize = getNumber (configFile >> "CfgMagazines" >> _randomItem >> "count");
|
_magazineSize = getNumber (configFile >> "CfgMagazines" >> _randomItem >> "count");
|
||||||
@ -67,7 +67,7 @@ if !(isNull _object) then{
|
|||||||
_loop = false;
|
_loop = false;
|
||||||
};
|
};
|
||||||
case "backpack": {
|
case "backpack": {
|
||||||
if (isClass (_pricingConfig >> _randomItem)) then {
|
if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then {
|
||||||
_object addBackpackCargoGlobal [_randomItem, _quan];
|
_object addBackpackCargoGlobal [_randomItem, _quan];
|
||||||
} else {
|
} else {
|
||||||
if (_debug) then {diag_log format["DEBUG: suppress spawn of %1 does not have price.",_randomItem]};
|
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;
|
_loop = false;
|
||||||
};
|
};
|
||||||
case "weapon": {
|
case "weapon": {
|
||||||
if (isClass (_pricingConfig >> _randomItem)) then {
|
if (isClass (_pricingConfig >> _randomItem) || _forceSpawn) then {
|
||||||
_object addWeaponCargoGlobal [_randomItem, _quan];
|
_object addWeaponCargoGlobal [_randomItem, _quan];
|
||||||
// only spawn mags that have prices
|
// only spawn mags that have prices
|
||||||
_mags = getArray (configFile >> "CfgWeapons" >> _randomItem >> "magazines") select {isClass (_pricingConfig >> _x)};
|
_mags = getArray (configFile >> "CfgWeapons" >> _randomItem >> "magazines") select {isClass (_pricingConfig >> _x)};
|
||||||
|
Loading…
Reference in New Issue
Block a user