Added proper dummy object cleanup code

This commit is contained in:
ulteq 2015-04-29 21:22:07 +02:00
parent 87d1f7c281
commit 608af39a67

View File

@ -19,13 +19,19 @@
* Public: Yes
*/
#include "script_component.hpp"
private ["_result", "_ignoreRange", "_pos"];
private ["_result", "_ignoreRange", "_helpers", "_pos"];
EXPLODE_3_PVT(_this,_unit,_range,_item);
_ignoreRange = (_range == -1);
_result = true;
if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false};
_helpers = attachedObjects (_item select 0);
{
detach _x;
deleteVehicle _x;
} forEach _helpers;
if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then {
private ["_exp", "_previousExp"];
_previousExp = _item select 0;