From 51287651f2adddca0d075751c890ffc51240ac01 Mon Sep 17 00:00:00 2001 From: icomrade Date: Sun, 24 Jul 2016 13:15:37 -0400 Subject: [PATCH] Add logging for non-existent loot group small This can probably be removed for release but for now I noticed HangarSmall doesn't exist, perhaps others as well. --- SQF/dayz_code/compile/building_spawnLoot.sqf | 37 +++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/SQF/dayz_code/compile/building_spawnLoot.sqf b/SQF/dayz_code/compile/building_spawnLoot.sqf index 5b0e95925..2647261ff 100644 --- a/SQF/dayz_code/compile/building_spawnLoot.sqf +++ b/SQF/dayz_code/compile/building_spawnLoot.sqf @@ -65,23 +65,26 @@ foreach _lootPos; if (isArray (_config >> "lootPosSmall")) then { _lootPos = getArray (_config >> "lootPosSmall"); _lootGroup = Loot_GetGroup((getText(_config >> "lootGroup")) + "Small"); - - { - //Get the world position of the spawn position - _worldPos = _this modelToWorld _x; - _worldPos set [2, 0 max (_worldPos select 2)]; - - //Delete existing lootpiles within 1m of spawn location + if (_lootGroup >= 1) then { { - deleteVehicle _x; - dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1; + //Get the world position of the spawn position + _worldPos = _this modelToWorld _x; + _worldPos set [2, 0 max (_worldPos select 2)]; + + //Delete existing lootpiles within 1m of spawn location + { + deleteVehicle _x; + dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1; + } + foreach (_worldPos nearObjects ["ReammoBox", 1]); + + if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then + { + Loot_SpawnGroup(_lootGroup, _worldPos); + }; } - foreach (_worldPos nearObjects ["ReammoBox", 1]); - - if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then - { - Loot_SpawnGroup(_lootGroup, _worldPos); - }; - } - foreach _lootPos; + foreach _lootPos; + } else { + diag_log format["Loot group small: %1 does not exist", ((getText(_config >> "lootGroup")) + "Small")]; + }; }; \ No newline at end of file