From 8143c8f7fc6fb781fe605f16adc0f63b4c2ae25b Mon Sep 17 00:00:00 2001 From: 82ndab-Bravo17 <82ndab.bravo17@gmail.com> Date: Thu, 6 Oct 2016 22:13:25 -0400 Subject: [PATCH] Fix for building parts not being returnrd on removal --- .../compile/epoch_bases/EPOCH_server_removeBUILD.sqf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf index 8e90e520..8bf6de38 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf @@ -163,8 +163,16 @@ if (_vehSlot != -1 || _storageSlot != "ABORT" || _isTemporary == 1) then{ [_building, _player] call EPOCH_server_save_killedBuilding; deleteVehicle _building; }; - // Normal config based payout + _nearbyWH = nearestObjects[_posWH, ["groundWeaponHolder"], 2]; + if !(_nearbyWH isEqualTo[]) then{ + _gwh = _nearbyWH select 0; + // _posWH = getPosATL _gwh; + } else { + _gwh = createVehicle["groundWeaponHolder", [0,0,0], [], 0, "CAN_COLLIDE"]; + _gwh setPosATL _posWH; + }; + { _gwh addMagazineCargoGlobal[_x select 0, _x select 1]; } forEach _removeParts;