Skip to content

Commit 5bf9983

Browse files
Allow climbing out of water
1 parent fd370cb commit 5bf9983

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

addons/main/functions/fnc_canClimb.sqf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ private _dir = vectorDirVisual _unit;
2424
// offset pos to line up with view
2525
_pos = _pos vectorAdd (([_dir] matrixMultiply GVAR(rotVect90) select 0) vectorMultiply 0.1);
2626

27+
if (animationState _unit select [1,3] in ["sdv","ssw","dve","swm"]) then {
28+
_pos = _pos vectorAdd [0,0,0.5];
29+
_unit setVariable [QGVAR(swimFix),animationState _unit];
30+
} else {
31+
_unit setVariable [QGVAR(swimFix),nil];
32+
};
33+
2734
private _animPosASL = +_pos;
2835
private _height = 0;
2936
private _targetHeight = 0;

addons/main/functions/fnc_startClimbing.sqf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ private _animDoneEHID = [_unit,"AnimDone",{
7575
_unit setPosASL _targetPosASL;
7676
ANIM_SPEED_COEF_END(_unit);
7777

78+
if (_unit getVariable [QGVAR(swimFix),""] isNotEqualTo "") then {
79+
_unit switchMove (_unit getVariable QGVAR(swimFix));
80+
_unit setVariable [QGVAR(swimFix),nil];
81+
};
82+
7883
// CBA event
7984
[QGVAR(climbingEnd),[_unit,_actionAnim,true]] call CBA_fnc_localEvent;
8085
};

addons/main/script_macros.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
!alive _unit || \
1616
{!(_unit in _unit)} || \
1717
{stance _unit == "PRONE"} || \
18-
{animationState _unit select [1,3] in ["bdv","bsw","dve","sdv","ssw","swm","inv"]} || \
18+
{animationState _unit select [1,3] in ["bdv","bsw","inv"]} || \
1919
{GVAR(actionExitConditions) findIf {_unit call _x} != -1} || \
2020
{_unit getVariable [QGVAR(isAssisting),false]}
2121

0 commit comments

Comments
 (0)