diff --git a/addons/sitting/functions/fnc_getRandomAnimation.sqf b/addons/sitting/functions/fnc_getRandomAnimation.sqf index ac8bd9e68d..b0aa2ba270 100644 --- a/addons/sitting/functions/fnc_getRandomAnimation.sqf +++ b/addons/sitting/functions/fnc_getRandomAnimation.sqf @@ -4,7 +4,7 @@ * Gets a random animations from the list. * * Arguments: - * None + * 0: Object to get animation pool from (default: objNull) * * Return Value: * Random Animation @@ -15,30 +15,42 @@ * Public: No */ +params [["_object", objNull, [objNull]]]; + +private _animations = []; + +if (!isNull _object) then { + _animations = getArray (configOf _object >> QGVAR(animations)); +}; + +if (_animations isEqualTo []) then { + _animations = [ + QGVAR(HubSittingChairA_idle1), + QGVAR(HubSittingChairA_idle2), + QGVAR(HubSittingChairA_idle3), + QGVAR(HubSittingChairA_move1), + QGVAR(HubSittingChairB_idle1), + QGVAR(HubSittingChairB_idle2), + QGVAR(HubSittingChairB_idle3), + QGVAR(HubSittingChairB_move1), + QGVAR(HubSittingChairC_idle1), + QGVAR(HubSittingChairC_idle2), + QGVAR(HubSittingChairC_idle3), + QGVAR(HubSittingChairC_move1), + QGVAR(HubSittingChairUA_idle1), + QGVAR(HubSittingChairUA_idle2), + QGVAR(HubSittingChairUA_idle3), + QGVAR(HubSittingChairUA_move1), + QGVAR(HubSittingChairUB_idle1), + QGVAR(HubSittingChairUB_idle2), + QGVAR(HubSittingChairUB_idle3), + QGVAR(HubSittingChairUB_move1), + QGVAR(HubSittingChairUC_idle1), + QGVAR(HubSittingChairUC_idle2), + QGVAR(HubSittingChairUC_idle3), + QGVAR(HubSittingChairUC_move1) + ]; +}; + // Select random animation from Animations Pool -selectRandom [ - QGVAR(HubSittingChairA_idle1), - QGVAR(HubSittingChairA_idle2), - QGVAR(HubSittingChairA_idle3), - QGVAR(HubSittingChairA_move1), - QGVAR(HubSittingChairB_idle1), - QGVAR(HubSittingChairB_idle2), - QGVAR(HubSittingChairB_idle3), - QGVAR(HubSittingChairB_move1), - QGVAR(HubSittingChairC_idle1), - QGVAR(HubSittingChairC_idle2), - QGVAR(HubSittingChairC_idle3), - QGVAR(HubSittingChairC_move1), - QGVAR(HubSittingChairUA_idle1), - QGVAR(HubSittingChairUA_idle2), - QGVAR(HubSittingChairUA_idle3), - QGVAR(HubSittingChairUA_move1), - QGVAR(HubSittingChairUB_idle1), - QGVAR(HubSittingChairUB_idle2), - QGVAR(HubSittingChairUB_idle3), - QGVAR(HubSittingChairUB_move1), - QGVAR(HubSittingChairUC_idle1), - QGVAR(HubSittingChairUC_idle2), - QGVAR(HubSittingChairUC_idle3), - QGVAR(HubSittingChairUC_move1) -] +selectRandom _animations diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 70e028719b..033a1f4d2c 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -48,7 +48,7 @@ if (_multiSitting) then { }; // Get random animation and perform it (before moving player to ensure correct placement) -[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations +[_player, [_seat] call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations [_player, "", 1] call EFUNC(common,doAnimation); // Correctly applies animation's config values (such as disallow throwing of grenades, intercept keybinds... etc). TRACE_2("Sit pos and dir",_sitPosition,_sitDirection); diff --git a/addons/spectator/functions/fnc_cam.sqf b/addons/spectator/functions/fnc_cam.sqf index d63a3c24a8..a9f8e97522 100644 --- a/addons/spectator/functions/fnc_cam.sqf +++ b/addons/spectator/functions/fnc_cam.sqf @@ -132,6 +132,9 @@ if (_init) then { GVAR(camDummy) = nil; // Stop tracking everything + { deleteVehicle _x; } forEach GVAR(camLights); + GVAR(camLights) = nil; + GVAR(camMode) = nil; GVAR(camVision) = nil; GVAR(camFocus) = nil; @@ -144,6 +147,5 @@ if (_init) then { GVAR(camYaw) = nil; GVAR(camPitch) = nil; GVAR(camSlow) = nil; - GVAR(camLights) = nil; GVAR(camLight) = nil; }; diff --git a/docs/wiki/class-names.md b/docs/wiki/class-names.md index d8537f0645..4a4f9b032f 100644 --- a/docs/wiki/class-names.md +++ b/docs/wiki/class-names.md @@ -240,6 +240,7 @@ ACE_plasmaIV_250 | Plasma IV (250ml) | ACE_ItemCore | ACE_salineIV | Saline IV (1000ml) | ACE_ItemCore | ACE_salineIV_500 | Saline IV (500ml) | ACE_ItemCore | ACE_salineIV_250 | Saline IV (250ml) | ACE_ItemCore | +ACE_suture | Suture | ACE_ItemCore | ACE_surgicalKit | Surgical Kit | ACE_ItemCore | ACE_tourniquet | Tourniquet (CAT) | ACE_ItemCore | ACE_medicalSupplyCrate | Simple ACE Medical Supply Crate | ammo box | diff --git a/docs/wiki/framework/sitting-framework.md b/docs/wiki/framework/sitting-framework.md index 09f59a9df4..b8f8ff37b0 100644 --- a/docs/wiki/framework/sitting-framework.md +++ b/docs/wiki/framework/sitting-framework.md @@ -29,6 +29,7 @@ class CfgVehicles { acex_sitting_sitDirection = 180; // Direction relative to object acex_sitting_sitPosition[] = {0, -0.1, -0.45}; // Position relative to object (may behave weird with certain objects) acex_sitting_interactPosition[] = {0, -0.1, -0.45}; + ace_sitting_animations[] = {"ace_sitting_HubSittingChairA_idle1"}; // Overwrite random animation pool XEH_ENABLED; // Enable XEH (only necessary if XEH is not yet enabled for this class or the one this inherits from) }; };