Fixed towing wrong orientation and locked even after unfold
This commit is contained in:
@@ -54,3 +54,42 @@ GVAR(towingList) = [
|
||||
_arty setPosWorld getPosWorld _arty;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(fold), {
|
||||
params ["_arty"];
|
||||
|
||||
if !([_arty] call FUNC(canFold)) exitWith {};
|
||||
|
||||
_arty lock true;
|
||||
|
||||
// animate
|
||||
private _curTur = _arty animationPhase "mainTurret";
|
||||
private _curGun = _arty animationPhase "mainGun";
|
||||
|
||||
_arty animateSource ["plate_back_source", 0, true];
|
||||
_arty animateSource ["plate_front_source", 1, true];
|
||||
_arty animateSource ["mainTurretT_source", -_curTur];
|
||||
_arty animateSource ["mainGunT_source", -_curGun + 0.1];
|
||||
_arty animateSource ["hydraulicsT_source", -_curGun + 0.1];
|
||||
_arty animateSource ["howitzer_rotation_source", 0, true];
|
||||
|
||||
_arty setVariable [QGVAR(folded), true, true];
|
||||
_arty enableRopeAttach true;
|
||||
}] call CBA_fnc_addEventHandler;;
|
||||
|
||||
[QGVAR(unfold), {
|
||||
params ["_arty"];
|
||||
|
||||
if !([_arty] call FUNC(canUnfold)) exitWith {};
|
||||
|
||||
_arty lock false;
|
||||
|
||||
// animate
|
||||
_arty animateSource ["plate_back_source", 1, true];
|
||||
_arty animateSource ["plate_front_source", 0, true];
|
||||
_arty animateSource ["mainTurretT_source", 0];
|
||||
_arty animateSource ["mainGunT_source", 0];
|
||||
_arty animateSource ["hydraulicsT_source", 0];
|
||||
|
||||
_arty setVariable [QGVAR(folded), false, true];
|
||||
_arty enableRopeAttach true;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
params ["_arty"];
|
||||
|
||||
_arty setVariable [QGVAR(towed), false, false];
|
||||
_arty setVariable [QGVAR(towed), false, true];
|
||||
|
||||
[QGVAR(detached), [_arty], QGVAR(towJIP)] call CBA_fnc_globalEventJIP;
|
||||
_arty animateSource ["rest_rotation_source", 0, 10];
|
||||
|
||||
@@ -25,21 +25,4 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params ["_arty"];
|
||||
|
||||
if !([_arty] call FUNC(canFold)) exitWith {};
|
||||
|
||||
_arty lock true;
|
||||
|
||||
// animate
|
||||
private _curTur = _arty animationPhase "mainTurret";
|
||||
private _curGun = _arty animationPhase "mainGun";
|
||||
|
||||
_arty animateSource ["plate_back_source", 0, true];
|
||||
_arty animateSource ["plate_front_source", 1, true];
|
||||
_arty animateSource ["mainTurretT_source", -_curTur];
|
||||
_arty animateSource ["mainGunT_source", -_curGun + 0.1];
|
||||
_arty animateSource ["hydraulicsT_source", -_curGun + 0.1];
|
||||
_arty animateSource ["howitzer_rotation_source", 0, true];
|
||||
|
||||
_arty setVariable [QGVAR(folded), true, true];
|
||||
_arty enableRopeAttach true;
|
||||
[QGVAR(fold), [_arty], _arty] call CBA_fnc_targetEvent;
|
||||
|
||||
@@ -43,7 +43,7 @@ private _canBeTowed = false;
|
||||
private _p = _veh modelToWorldVisual [_x#1#0, _x#1#1, _x#1#2];
|
||||
if (_p distance _pos < ATTACH_RADIUS) exitWith {
|
||||
_canBeTowed = true;
|
||||
[QGVAR(tow), [_arty, _veh, _x#1#0, _x#1#1, _x#1#2, _x#2]] call CBA_fnc_serverEvent;
|
||||
[QGVAR(tow), [_arty, _veh, _x#1#0, _x#1#1, _x#1#2, _x#2], _arty] call CBA_fnc_targetEvent;
|
||||
};
|
||||
};
|
||||
} forEach GVAR(towingList);
|
||||
|
||||
@@ -25,17 +25,4 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params ["_arty"];
|
||||
|
||||
if !([_arty] call FUNC(canUnfold)) exitWith {};
|
||||
|
||||
_arty lock false;
|
||||
|
||||
// animate
|
||||
_arty animateSource ["plate_back_source", 1, true];
|
||||
_arty animateSource ["plate_front_source", 0, true];
|
||||
_arty animateSource ["mainTurretT_source", 0];
|
||||
_arty animateSource ["mainGunT_source", 0];
|
||||
_arty animateSource ["hydraulicsT_source", 0];
|
||||
|
||||
_arty setVariable [QGVAR(folded), false, true];
|
||||
_arty enableRopeAttach true;
|
||||
[QGVAR(unfold), [_arty], _arty] call CBA_fnc_targetEvent;
|
||||
|
||||
Reference in New Issue
Block a user