mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #4605 from acemod/draggingFixes
Disable collision while carrying, Fix floating on disabled simulation objects
This commit is contained in:
commit
4968d9073e
@ -83,6 +83,11 @@
|
|||||||
_vehicle engineOn false;
|
_vehicle engineOn false;
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
[QGVAR(setMass), {
|
||||||
|
params ["_object", "_mass"];
|
||||||
|
_object setMass _mass;
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
|
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
|
||||||
//This variable is used for isPlayer checks
|
//This variable is used for isPlayer checks
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
|
@ -171,7 +171,7 @@ class CfgVehicles {
|
|||||||
|
|
||||||
GVAR(canDrag) = 1;
|
GVAR(canDrag) = 1;
|
||||||
GVAR(dragPosition[]) = {0,1.2,0};
|
GVAR(dragPosition[]) = {0,1.2,0};
|
||||||
GVAR(dragDirection) = 0;
|
GVAR(dragDirection) = 270;
|
||||||
};
|
};
|
||||||
class MetalCase_01_base_F: Items_base_F {
|
class MetalCase_01_base_F: Items_base_F {
|
||||||
class EventHandlers {
|
class EventHandlers {
|
||||||
@ -213,7 +213,7 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
GVAR(canCarry) = 1;
|
GVAR(canCarry) = 1;
|
||||||
GVAR(carryPosition[]) = {0,1,1};
|
GVAR(carryPosition[]) = {0,1,1};
|
||||||
GVAR(carryDirection) = 270;
|
GVAR(carryDirection) = 0;
|
||||||
|
|
||||||
GVAR(canDrag) = 1;
|
GVAR(canDrag) = 1;
|
||||||
GVAR(dragPosition[]) = {0,1.4,0};
|
GVAR(dragPosition[]) = {0,1.4,0};
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
params ["_args", "_idPFH"];
|
params ["_args", "_idPFH"];
|
||||||
_args params ["_unit","_target", "_startTime"];
|
_args params ["_unit", "_target", "_startTime"];
|
||||||
|
|
||||||
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
||||||
TRACE_2("carry false",_unit,_target);
|
TRACE_2("carry false",_unit,_target);
|
||||||
@ -35,7 +35,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
|
|||||||
if (!alive _target || {_unit distance _target > 10}) then {
|
if (!alive _target || {_unit distance _target > 10}) then {
|
||||||
TRACE_2("dead/distance",_unit,_target);
|
TRACE_2("dead/distance",_unit,_target);
|
||||||
if ((_unit distance _target > 10) && {(CBA_missionTime - _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,
|
//attachTo seems to have some kind of network delay and target can return an odd position during 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)
|
//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,CBA_missionTime);
|
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime);
|
||||||
};
|
};
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
params ["_args", "_idPFH"];
|
params ["_args", "_idPFH"];
|
||||||
_args params ["_unit","_target", "_startTime"];
|
_args params ["_unit", "_target", "_startTime"];
|
||||||
|
|
||||||
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
||||||
TRACE_2("drag false",_unit,_target);
|
TRACE_2("drag false",_unit,_target);
|
||||||
@ -35,7 +35,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
|
|||||||
if (!alive _target || {_unit distance _target > 10}) then {
|
if (!alive _target || {_unit distance _target > 10}) then {
|
||||||
TRACE_2("dead/distance",_unit,_target);
|
TRACE_2("dead/distance",_unit,_target);
|
||||||
if ((_unit distance _target > 10) && {(CBA_missionTime - _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,
|
//attachTo seems to have some kind of network delay and target can return an odd position during 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)
|
//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,CBA_missionTime);
|
TRACE_3("ignoring bad distance at start",_unit distance _target,_startTime,CBA_missionTime);
|
||||||
};
|
};
|
||||||
|
@ -76,3 +76,10 @@ if (_unit getVariable ["ACE_isUnconscious", false]) then {
|
|||||||
if (_target getVariable [QGVAR(isUAV), false]) then {
|
if (_target getVariable [QGVAR(isUAV), false]) then {
|
||||||
createVehicleCrew _target;
|
createVehicleCrew _target;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// reset mass
|
||||||
|
private _mass = _target getVariable [QGVAR(originalMass), 0];
|
||||||
|
|
||||||
|
if (_mass != 0) then {
|
||||||
|
[QEGVAR(common,setMass), [_target, _mass], _target] call CBA_fnc_targetEvent;
|
||||||
|
};
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_unit", "_target"];
|
params ["_unit", "_target"];
|
||||||
TRACE_2("params",_unit,_target);
|
TRACE_1("params",_this);
|
||||||
|
|
||||||
// remove drop action
|
// remove drop action
|
||||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
|
||||||
@ -76,3 +76,10 @@ if !(_target isKindOf "CAManBase") then {
|
|||||||
if (_target getVariable [QGVAR(isUAV), false]) then {
|
if (_target getVariable [QGVAR(isUAV), false]) then {
|
||||||
createVehicleCrew _target;
|
createVehicleCrew _target;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// reset mass
|
||||||
|
private _mass = _target getVariable [QGVAR(originalMass), 0];
|
||||||
|
|
||||||
|
if (_mass != 0) then {
|
||||||
|
[QEGVAR(common,setMass), [_target, _mass], _target] call CBA_fnc_targetEvent;
|
||||||
|
};
|
||||||
|
@ -73,3 +73,11 @@ _unit setVariable [QGVAR(isCarrying), true, true];
|
|||||||
_unit setVariable [QGVAR(carriedObject), _target, true];
|
_unit setVariable [QGVAR(carriedObject), _target, true];
|
||||||
|
|
||||||
[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
|
[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
|
// disable collisions by setting the physx mass to almost zero
|
||||||
|
private _mass = getMass _target;
|
||||||
|
|
||||||
|
if (_mass > 1) then {
|
||||||
|
_target setVariable [QGVAR(originalMass), _mass, true];
|
||||||
|
[QEGVAR(common,setMass), [_target, 1e-12], _target] call CBA_fnc_targetEvent;
|
||||||
|
};
|
||||||
|
@ -61,3 +61,11 @@ if (_target isKindOf "CAManBase") then {
|
|||||||
_unit setVariable [QGVAR(isDragging), true, true];
|
_unit setVariable [QGVAR(isDragging), true, true];
|
||||||
|
|
||||||
[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
|
[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
|
// disable collisions by setting the physx mass to almost zero
|
||||||
|
private _mass = getMass _target;
|
||||||
|
|
||||||
|
if (_mass > 1) then {
|
||||||
|
_target setVariable [QGVAR(originalMass), _mass, true];
|
||||||
|
[QEGVAR(common,setMass), [_target, 1e-12], _target] call CBA_fnc_targetEvent;
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user