mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Attach fix and param trace
This commit is contained in:
parent
b5a6e1e883
commit
f1d44972c9
@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
|
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
|
||||||
params ["_attachToVehicle","_unit","_args"];
|
params ["_attachToVehicle","_unit","_args"];
|
||||||
_args params [["_itemClassname",""]];
|
_args params [["_itemClassname","", [""]]];
|
||||||
|
TRACE_3("params",_attachToVehicle,_unit,_itemClassname);
|
||||||
|
|
||||||
//Sanity Check (_unit has item in inventory, not over attach limit)
|
//Sanity Check (_unit has item in inventory, not over attach limit)
|
||||||
if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");};
|
if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");};
|
||||||
|
@ -19,11 +19,12 @@
|
|||||||
|
|
||||||
private ["_attachLimit", "_attachedObjects","_playerPos"];
|
private ["_attachLimit", "_attachedObjects","_playerPos"];
|
||||||
params ["_attachToVehicle","_player","_args"];
|
params ["_attachToVehicle","_player","_args"];
|
||||||
_args params [["_itemname",""]];
|
_args params [["_itemClassname","", [""]]];
|
||||||
|
TRACE_3("params",_attachToVehicle,_unit,_itemClassname);
|
||||||
|
|
||||||
_attachLimit = [6, 1] select (_player == _attachToVehicle);
|
_attachLimit = [6, 1] select (_player == _attachToVehicle);
|
||||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
||||||
|
|
||||||
_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"));
|
_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"));
|
||||||
|
|
||||||
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])};
|
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])};
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
private ["_attachedObjects", "_inRange"];
|
private ["_attachedObjects", "_inRange"];
|
||||||
params ["_attachToVehicle", "_unit"];
|
params ["_attachToVehicle", "_unit"];
|
||||||
|
TRACE_2("params",_attachToVehicle,_unit);
|
||||||
|
|
||||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ private ["_attachedObjects", "_attachedItems", "_itemDisplayName",
|
|||||||
"_unitPos", "_objectPos"
|
"_unitPos", "_objectPos"
|
||||||
];
|
];
|
||||||
params ["_attachToVehicle","_unit"],
|
params ["_attachToVehicle","_unit"],
|
||||||
|
TRACE_2("params",_attachToVehicle,_unit);
|
||||||
|
|
||||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
||||||
_attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []];
|
_attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []];
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"];
|
private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"];
|
||||||
params ["_target","_player"];
|
params ["_target","_player"];
|
||||||
|
TRACE_2("params",_target,_player);
|
||||||
|
|
||||||
_listed = [];
|
_listed = [];
|
||||||
_actions = [];
|
_actions = [];
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
|
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
|
||||||
|
|
||||||
params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"];
|
params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"];
|
||||||
|
TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
|
||||||
|
|
||||||
_startingOffset = _attachToVehicle worldToModel _startingPosition;
|
_startingOffset = _attachToVehicle worldToModel _startingPosition;
|
||||||
|
|
||||||
_startDistanceFromCenter = vectorMagnitude _startingOffset;
|
_startDistanceFromCenter = vectorMagnitude _startingOffset;
|
||||||
|
Loading…
Reference in New Issue
Block a user