From e0005850b8fcb1b6f106162845b6abc8420245ad Mon Sep 17 00:00:00 2001 From: icomrade Date: Fri, 8 Sep 2017 11:12:40 -0400 Subject: [PATCH] Prevent loot pile cleanup right next to player https://github.com/DayZMod/DayZ/commit/726155f16d3f308e77ec549e3956a72f163b7968 --- SQF/dayz_code/compile/building_spawnLoot.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_code/compile/building_spawnLoot.sqf b/SQF/dayz_code/compile/building_spawnLoot.sqf index fb0a410aa..1d5b70ed9 100644 --- a/SQF/dayz_code/compile/building_spawnLoot.sqf +++ b/SQF/dayz_code/compile/building_spawnLoot.sqf @@ -44,10 +44,12 @@ _lootGroup = Loot_GetGroup(getText(_config >> "lootGroup")); _worldPos = _this modelToWorld _x; _worldPos set [2, 0 max (_worldPos select 2)]; - //Delete existing lootpiles within 1m of spawn location + //Delete existing lootpiles within 1m of spawn location if no player is right next to it { - deleteVehicle _x; - dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1; + if ({isPlayer _x} count (_x nearEntities ["CAManBase",4]) == 0) then { + deleteVehicle _x; + dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1; + }; } foreach (_worldPos nearObjects ["ReammoBox", 1]);