ACE3/addons/sitting/functions/fnc_stand.sqf
jonpas 6ca9d59443
Merge ACEX (#8415)
* Merge ACEX - first attempt
Backwards compatibility with XGVAR set of macros used on all settings and config entries
Public API functions not taken into account yet, many other things probably still missed

* Resolve issues

* Switch to addSetting, backward compatible CfgPatches, missed XGVAR.

* Remove unnecessary backwards compat

* Convert ACEX Categorised settings to initSettings / Fix Intel items magazine

* Apply suggestions from code review

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Remove maintainers from merged ACEX components

* Cleanup unused module and faction classes

* Sitting - Add more object configs by @Dystopian
https://github.com/acemod/ACEX/pull/255

* Translations - Add Japanese by @classicarma
https://github.com/acemod/ACEX/pull/259

* Kill Tracker - Add killtracker.inc public include file by @Freddo3000"
https://github.com/acemod/ACEX/pull/251

* Add ACEX authors and sort authors file

* acex - final tweaks (#8513)

* acex - handle old funcs

* replace thirst/hunger setvars to acex naming

fix macro

Revert "fix macro"

This reverts commit d807e5e804c43916eaa42d34a89af94c6d9a48ad.

Revert "replace thirst/hunger setvars to acex naming"

This reverts commit bafc607884932d6e339daedc7c22e25dddbdd868.

x

Co-authored-by: TyroneMF <TyroneMF@hotmail.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2021-10-14 10:46:43 -05:00

53 lines
1.3 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: Jonpas
* Stands up the player.
*
* Arguments:
* Player <OBJECT>
*
* Return Value:
* None
*
* Example:
* player call acex_sitting_fnc_stand
*
* Public: No
*/
params ["_player"];
TRACE_1("stand",_player);
(_player getVariable QGVAR(sittingStatus)) params ["_seat", "_actionID", ["_seatPos", 0]];
TRACE_3("sittingStatus",_seat,_actionID,_seatPos);
// 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 sitting status to nil
_player setVariable [QGVAR(sittingStatus), nil];
["ace_stoodUp", [_player, _seat, _seatPos]] call CBA_fnc_localEvent;
if (isNull _seat) exitWith {};
// Allow sitting on this seat again
private _seatsClaimed = _seat getVariable [QGVAR(seatsClaimed), []];
_seatsClaimed set [_seatPos, false];
_seat setVariable [QGVAR(seatsClaimed), _seatsClaimed, true];
// Unclaim if no one else sitting on it
if (_seatsClaimed find true == -1) then {
[objNull, _seat] call EFUNC(common,claim);
};