mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
tweak doAnimation switchMove to do no akward camera jumps whenever possible, fix #2474
This commit is contained in:
parent
b8c687611e
commit
a09ca8fb80
@ -44,6 +44,8 @@ if (_animation == "") then {
|
||||
_animation = [_unit] call FUNC(getDefaultAnim);
|
||||
};
|
||||
|
||||
//if (_animation == animationState _unit) exitWith {};
|
||||
|
||||
switch (_priority) do {
|
||||
case 0 : {
|
||||
if (_unit == vehicle _unit) then {
|
||||
@ -62,8 +64,19 @@ switch (_priority) do {
|
||||
};
|
||||
};
|
||||
case 2 : {
|
||||
// Execute on all machines. SwitchMove has local effects.
|
||||
[_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
// try playMoveNow first
|
||||
if (_unit == vehicle _unit) then {
|
||||
[_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc);
|
||||
} else {
|
||||
// Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles.
|
||||
[_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
};
|
||||
|
||||
// if animation doesn't respond, do switchMove
|
||||
if (animationState _unit != _animation) then {
|
||||
// Execute on all machines. SwitchMove has local effects.
|
||||
[_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc);
|
||||
};
|
||||
};
|
||||
default {};
|
||||
};
|
||||
|
@ -35,6 +35,7 @@ if (vehicle _caller == _caller) then {
|
||||
case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"};
|
||||
case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"};
|
||||
};
|
||||
|
||||
[_caller, _lastAnim, 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
private ["_config", "_callback", "_weaponSelect", "_lastAnim"];
|
||||
params ["_args"];
|
||||
_args params ["_caller", "_target","_selectionName","_className", "_items", "_usersOfItems"];
|
||||
_args params ["_caller", "_target", "_selectionName", "_className", "_items", "_usersOfItems"];
|
||||
|
||||
if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
|
||||
_caller removeWeapon "ACE_FakePrimaryWeapon";
|
||||
@ -28,13 +28,14 @@ if (vehicle _caller == _caller) then {
|
||||
_lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""];
|
||||
//Don't play another medic animation (when player is rapidily treating)
|
||||
TRACE_2("Reseting to old animation", animationState player, _lastAnim);
|
||||
switch (tolower _lastAnim) do {
|
||||
switch (toLower _lastAnim) do {
|
||||
case "ainvpknlmstpslaywrfldnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"};
|
||||
case "ainvppnemstpslaywrfldnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"};
|
||||
case "ainvpknlmstpslaywnondnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"};
|
||||
case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"};
|
||||
case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"};
|
||||
};
|
||||
|
||||
[_caller, _lastAnim, 2] call EFUNC(common,doAnimation);
|
||||
};
|
||||
_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil];
|
||||
|
Loading…
Reference in New Issue
Block a user