mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
replace timePFH with CBA_missionTime
This commit is contained in:
@ -64,7 +64,7 @@ if (_target isKindOf "CAManBase") then {
|
||||
};
|
||||
|
||||
// check everything
|
||||
[FUNC(carryObjectPFH), 0.5, [_unit, _target, ACE_time]] call CBA_fnc_addPerFrameHandler;
|
||||
[FUNC(carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// reset current dragging height.
|
||||
GVAR(currentHeightChange) = 0;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_DRAGGING
|
||||
systemChat format ["%1 carryObjectPFH running", ACE_time];
|
||||
systemChat format ["%1 carryObjectPFH running", CBA_missionTime];
|
||||
#endif
|
||||
|
||||
params ["_args", "_idPFH"];
|
||||
@ -34,10 +34,10 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
TRACE_2("dead/distance",_unit,_target);
|
||||
if ((_unit distance _target > 10) && {(ACE_time - _startTime) < 1}) exitWith {
|
||||
if ((_unit distance _target > 10) && {(CBA_missionTime - _startTime) < 1}) exitWith {
|
||||
//attachTo seems to have some kind of network delay and target can return an odd position durring the first few frames,
|
||||
//so wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos)
|
||||
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,ACE_time);
|
||||
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime);
|
||||
};
|
||||
[_unit, _target] call FUNC(dropObject_carry);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
|
@ -53,7 +53,7 @@ _unit setVariable [QGVAR(ReleaseActionID), [
|
||||
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
// check everything
|
||||
[FUNC(dragObjectPFH), 0.5, [_unit, _target, ACE_time]] call CBA_fnc_addPerFrameHandler;
|
||||
[FUNC(dragObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// reset current dragging height.
|
||||
GVAR(currentHeightChange) = 0;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_DRAGGING
|
||||
systemChat format ["%1 dragObjectPFH running", ACE_time];
|
||||
systemChat format ["%1 dragObjectPFH running", CBA_missionTime];
|
||||
#endif
|
||||
|
||||
params ["_args", "_idPFH"];
|
||||
@ -34,10 +34,10 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
TRACE_2("dead/distance",_unit,_target);
|
||||
if ((_unit distance _target > 10) && {(ACE_time - _startTime) < 1}) exitWith {
|
||||
if ((_unit distance _target > 10) && {(CBA_missionTime - _startTime) < 1}) exitWith {
|
||||
//attachTo seems to have some kind of network delay and target can return an odd position durring the first few frames,
|
||||
//so wait a full second to exit if out of range (this is critical as we would otherwise detach and set it's pos to weird pos)
|
||||
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,ACE_time);
|
||||
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime);
|
||||
};
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
|
@ -26,7 +26,7 @@ if (_weight > missionNamespace getVariable ["ACE_maxWeightCarry", 1E11]) exitWit
|
||||
[localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
|
||||
private _timer = ACE_time + 5;
|
||||
private _timer = CBA_missionTime + 5;
|
||||
|
||||
// handle objects vs persons
|
||||
if (_target isKindOf "CAManBase") then {
|
||||
@ -46,7 +46,7 @@ if (_target isKindOf "CAManBase") then {
|
||||
[_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2, true] call EFUNC(common,doAnimation);
|
||||
[_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2, true] call EFUNC(common,doAnimation);
|
||||
|
||||
_timer = ACE_time + 15;
|
||||
_timer = CBA_missionTime + 15;
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_DRAGGING
|
||||
systemChat format ["%1 startCarryPFH running", ACE_time];
|
||||
systemChat format ["%1 startCarryPFH running", CBA_missionTime];
|
||||
#endif
|
||||
|
||||
params ["_args", "_idPFH"];
|
||||
@ -28,28 +28,28 @@ _args params ["_unit", "_target", "_timeOut"];
|
||||
|
||||
// handle aborting carry
|
||||
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||
TRACE_4("carry false",_unit,_target,_timeOut,ACE_time);
|
||||
TRACE_4("carry false",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
TRACE_4("dead/distance",_unit,_target,_timeOut,ACE_time);
|
||||
TRACE_4("dead/distance",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// handle persons vs objects
|
||||
if (_target isKindOf "CAManBase") then {
|
||||
if (ACE_time > _timeOut) exitWith {
|
||||
TRACE_4("Start carry person",_unit,_target,_timeOut,ACE_time);
|
||||
if (CBA_missionTime > _timeOut) exitWith {
|
||||
TRACE_4("Start carry person",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_unit, _target] call FUNC(carryObject);
|
||||
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
} else {
|
||||
if (ACE_time > _timeOut) exitWith {
|
||||
TRACE_4("timeout",_unit,_target,_timeOut,ACE_time);
|
||||
if (CBA_missionTime > _timeOut) exitWith {
|
||||
TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
// drop if in timeout
|
||||
@ -59,7 +59,7 @@ if (_target isKindOf "CAManBase") then {
|
||||
|
||||
// wait for the unit to stand up
|
||||
if (stance _unit == "STAND") exitWith {
|
||||
TRACE_4("Start carry object",_unit,_target,_timeOut,ACE_time);
|
||||
TRACE_4("Start carry object",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_unit, _target] call FUNC(carryObject);
|
||||
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
|
@ -52,4 +52,4 @@ if (_target isKindOf "CAManBase") then {
|
||||
// prevents draging and carrying at the same time
|
||||
_unit setVariable [QGVAR(isDragging), true, true];
|
||||
|
||||
[FUNC(startDragPFH), 0.2, [_unit, _target, ACE_time + 5]] call CBA_fnc_addPerFrameHandler;
|
||||
[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_DRAGGING
|
||||
systemChat format ["%1 startDragPFH running", ACE_time];
|
||||
systemChat format ["%1 startDragPFH running", CBA_missionTime];
|
||||
#endif
|
||||
|
||||
params ["_args", "_idPFH"];
|
||||
@ -28,20 +28,20 @@ _args params ["_unit", "_target", "_timeOut"];
|
||||
|
||||
// handle aborting drag
|
||||
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||
TRACE_4("drag false",_unit,_target,_timeOut,ACE_time);
|
||||
TRACE_4("drag false",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
|
||||
if (!alive _target || {_unit distance _target > 10}) then {
|
||||
TRACE_4("dead/distance",_unit,_target,_timeOut,ACE_time);
|
||||
TRACE_4("dead/distance",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_unit, _target] call FUNC(dropObject);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame time.
|
||||
if (ACE_time > _timeOut) exitWith {
|
||||
TRACE_4("timeout",_unit,_target,_timeOut,ACE_time);
|
||||
// timeout. Do nothing. Quit. CBA_missionTime, because anim length is linked to ingame time.
|
||||
if (CBA_missionTime > _timeOut) exitWith {
|
||||
TRACE_4("timeout",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
|
||||
// drop if in timeout
|
||||
@ -51,7 +51,7 @@ if (ACE_time > _timeOut) exitWith {
|
||||
|
||||
// unit is ready to start dragging
|
||||
if (animationState _unit in DRAG_ANIMATIONS) exitWith {
|
||||
TRACE_4("Start Dragging",_unit,_target,_timeOut,ACE_time);
|
||||
TRACE_4("Start Dragging",_unit,_target,_timeOut,CBA_missionTime);
|
||||
[_unit, _target] call FUNC(dragObject);
|
||||
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
|
Reference in New Issue
Block a user