2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-09-18 14:33:53 +00:00
|
|
|
/*
|
|
|
|
* Author: rocko
|
|
|
|
* Fixes animation issues that may get you stuck
|
2015-07-28 04:11:29 +00:00
|
|
|
*
|
2015-09-18 14:33:53 +00:00
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [] call ace_common_fnc_headBugFix
|
|
|
|
*
|
2015-09-18 14:33:53 +00:00
|
|
|
* Public: Yes
|
|
|
|
*
|
|
|
|
* Note: Has to be spawned not called
|
2015-07-28 04:11:29 +00:00
|
|
|
*/
|
2015-08-02 01:01:35 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _unit = ACE_player;
|
|
|
|
private _anim = animationState _unit;
|
2015-09-18 14:33:53 +00:00
|
|
|
|
2016-06-03 19:38:16 +00:00
|
|
|
[QGVAR(headbugFixUsed), [profileName, _anim]] call CBA_fnc_serverEvent;
|
|
|
|
[QGVAR(headbugFixUsed), [profileName, _anim]] call CBA_fnc_localEvent;
|
2015-08-02 01:01:35 +00:00
|
|
|
|
2015-09-18 14:33:53 +00:00
|
|
|
if (_unit != vehicle _unit || {!([_unit, objNull, ["isNotSitting"]] call FUNC(canInteractWith))}) exitWith {false};
|
2015-08-02 01:01:35 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _pos = getPosATL _unit;
|
|
|
|
private _dir = getDir _unit;
|
2015-08-02 01:01:35 +00:00
|
|
|
|
2015-07-28 04:11:29 +00:00
|
|
|
titleCut ["", "BLACK"];
|
2015-09-18 14:33:53 +00:00
|
|
|
[_unit, "headBugFix"] call FUNC(hideUnit);
|
2015-08-02 01:01:35 +00:00
|
|
|
|
2015-07-28 04:11:29 +00:00
|
|
|
// create invisible headbug fix vehicle
|
2015-12-12 15:48:54 +00:00
|
|
|
private _dummy = createVehicle ["ACE_Headbug_Fix", _pos, [], 0, "NONE"];
|
2015-09-18 14:33:53 +00:00
|
|
|
_dummy setDir _dir;
|
|
|
|
_unit moveInAny _dummy;
|
2015-09-19 20:27:23 +00:00
|
|
|
sleep 0.1; // @todo
|
2015-08-04 14:43:42 +00:00
|
|
|
|
2015-09-18 14:33:53 +00:00
|
|
|
unassignVehicle _unit;
|
|
|
|
_unit action ["Eject", vehicle _unit];
|
|
|
|
_unit setDir _dir;
|
|
|
|
_unit setPosATL _pos;
|
2015-07-28 04:11:29 +00:00
|
|
|
sleep 1.0;
|
2015-08-04 14:43:42 +00:00
|
|
|
|
2015-09-18 14:33:53 +00:00
|
|
|
deleteVehicle _dummy;
|
2015-08-02 17:44:49 +00:00
|
|
|
|
2015-09-18 14:33:53 +00:00
|
|
|
[_unit, "headBugFix"] call FUNC(unhideUnit);
|
2015-07-28 04:11:29 +00:00
|
|
|
titleCut ["", "PLAIN"];
|
2015-08-02 01:01:35 +00:00
|
|
|
true
|