Merge pull request #3079 from jonpas/tacticalLadderFixes

Prevent Tactical Ladder interaction if unit on ladder
This commit is contained in:
Thomas Kooi
2016-02-20 16:59:23 +01:00
6 changed files with 53 additions and 12 deletions

View File

@ -40,9 +40,9 @@ if (GETMVAR(ACE_Modifier,0) == 0) then {
};
};
} else {
// Tilting
GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 30;
GVAR(ladder) animate ["rotate", GVAR(currentAngle)];
// Tilting (disabled due to sinking, interaction point offset and unsuitable animation)
//GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 30;
//GVAR(ladder) animate ["rotate", GVAR(currentAngle)];
};
true

View File

@ -0,0 +1,31 @@
/*
* Author: Jonpas
* Checks if Tactical Ladder is empty (no one climbing it).
*
* Arguments:
* 0: Ladder <OBJECT>
*
* Return Value:
* Can Be Picked Up <BOOL>
*
* Example:
* [ladder] call ace_tacticalladder_fnc_isLadderEmpty;
*
* Public: No
*/
#include "script_component.hpp"
params ["_ladder"];
private _unitsNearLadder = nearestObjects [_ladder, ["CAManBase"], 4];
TRACE_1("Near Ladder",_unitsNearLadder);
private _ladderEmpty = true;
{
if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _x >> "ACE_isLadder") == 1) exitWith {
_ladderEmpty = false;
TRACE_1("On Ladder",_x);
};
} forEach _unitsNearLadder;
_ladderEmpty

View File

@ -42,7 +42,8 @@ GVAR(currentStep) = 3;
GVAR(currentAngle) = 0;
// add mouse buttons and hints
[localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint);
//private _adjustText = format ["%1, +%2", localize LSTRING(Adjust), localize LSTRING(AdjustTilt)]; // Tilting disabled due to sinking, interaction point offset and unsuitable animation
[localize LSTRING(Deploy), localize LSTRING(Drop), /*_adjustText*/ localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint);
_unit setVariable [QGVAR(Deploy), [
_unit, "DefaultAction",