ACE3/addons/sitting/functions/fnc_stand.sqf
PabstMirror d372111d3f Sitting Cleanup
- Add modern privates
- Don't add actions, canInteractWith, or EH if not enabled
2015-12-30 12:23:35 -06:00

39 lines
877 B
Plaintext

/*
* Author: Jonpas
* Stands up the player.
*
* Arguments:
* Player <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call ace_sitting_fnc_stand;
*
* Public: No
*/
#include "script_component.hpp"
params ["_player"];
(_player getVariable QGVAR(isSitting)) params ["_seat", "_actionID"];
// Remove scroll-wheel action
_player removeAction _actionID;
// Restore animation
private _animation = switch (currentWeapon _player) do {
case "": {"amovpercmstpsnonwnondnon"};
case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"};
case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"};
default {"amovpercmstpsnonwnondnon"};
};
[_player, _animation, 2] call EFUNC(common,doAnimation);
// Set variables to nil
_player setVariable [QGVAR(isSitting), nil];
if (isNull _seat) exitWith {};
_seat setVariable [QGVAR(seatOccupied), nil, true];