This commit is contained in:
PabstMirror 2015-08-29 09:38:57 -05:00
parent 007859d42e
commit f6c752045c
3 changed files with 7 additions and 6 deletions

View File

@ -19,7 +19,7 @@
params ["_attachToVehicle","_unit"],
TRACE_2("params",_attachToVehicle,_unit);
private ["_attachedList", "_itemDisplayName", "_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_unitPos", "_objectPos"];
private ["_attachedList", "_itemDisplayName", "_attachedObject", "_attachedIndex", "_itemName", "_minDistance"];
_attachedList = _attachToVehicle getVariable [QGVAR(attached), []];

View File

@ -27,7 +27,7 @@ private ["_attachedList"];
_attachedList = _unit getVariable [QGVAR(attached), []];
if ((count _attachedList) == 0) exitWith {};
(_attachedList select 0) params ["_xObject", "_xItemName"];
(_attachedList select 0) params ["_xObject"];
if (!isNull _xObject) then {
detach _xObject;
_xObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]);

View File

@ -1,6 +1,7 @@
/*
* Author: PabstMirror
* Handles when vehicle or man is killed.
* Note: Runs where unit is local.
*
* Arguments:
* 0: DeadVehicle <OBJECT>
@ -15,9 +16,8 @@
*/
#include "script_component.hpp"
if (!isServer) exitWith {};
params ["_deadUnit"];
TRACE_1("params",_deadUnit);
private ["_attachedList"];
@ -26,7 +26,8 @@ _attachedList = _deadUnit getVariable [QGVAR(attached), []];
if ((count _attachedList) == 0) exitWith {};
{
_x params ["_xObject", "_xItemName"];
_x params ["_xObject"];
TRACE_2("detaching",_xObject,_deadUnit);
detach _xObject;
} forEach _attachedList;