2015-07-28 04:11:29 +00:00
|
|
|
/**
|
|
|
|
* fnc_headbugfix.sqf
|
|
|
|
* @Descr: Fixes animation issues that may get you stuck
|
|
|
|
* @Author: rocko
|
|
|
|
*
|
|
|
|
* @Arguments:
|
|
|
|
* @Return: nil
|
|
|
|
* @PublicAPI: true
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
2015-07-28 20:56:22 +00:00
|
|
|
private ["_pos","_dir","_anim"];
|
2015-08-02 01:01:35 +00:00
|
|
|
|
|
|
|
_anim = animationState ACE_player;
|
2015-08-04 14:43:42 +00:00
|
|
|
["HeadbugFixUsed", [profileName, _anim]] call FUNC(serverEvent);
|
|
|
|
["HeadbugFixUsed", [profileName, _anim]] call FUNC(localEvent);
|
2015-08-02 01:01:35 +00:00
|
|
|
|
|
|
|
if (ACE_player != vehicle ACE_player || { !([ACE_player, objNull, ["isNotSitting"]] call FUNC(canInteractWith)) } ) exitWith {false};
|
|
|
|
|
|
|
|
_pos = getposATL ACE_player;
|
|
|
|
_dir = getDir ACE_player;
|
|
|
|
|
2015-07-28 04:11:29 +00:00
|
|
|
titleCut ["", "BLACK"];
|
2015-08-04 14:43:42 +00:00
|
|
|
[ACE_Player, "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-08-04 14:43:42 +00:00
|
|
|
_ACE_HeadbugFix = "ACE_Headbug_Fix" createVehicleLocal _pos;
|
2015-07-28 20:56:22 +00:00
|
|
|
_ACE_HeadbugFix setDir _dir;
|
2015-08-02 01:01:35 +00:00
|
|
|
ACE_player moveInAny _ACE_HeadbugFix;
|
2015-08-02 17:44:49 +00:00
|
|
|
sleep 0.1;
|
2015-08-04 14:43:42 +00:00
|
|
|
|
2015-08-02 01:01:35 +00:00
|
|
|
unassignVehicle ACE_player;
|
|
|
|
ACE_player action ["Eject", vehicle ACE_player];
|
2015-08-02 17:44:49 +00:00
|
|
|
ACE_player setDir _dir;
|
|
|
|
ACE_player setposATL _pos;
|
2015-07-28 04:11:29 +00:00
|
|
|
sleep 1.0;
|
2015-08-04 14:43:42 +00:00
|
|
|
|
2015-07-28 04:11:29 +00:00
|
|
|
deleteVehicle _ACE_HeadbugFix;
|
2015-08-02 17:44:49 +00:00
|
|
|
|
2015-08-04 14:43:42 +00:00
|
|
|
[ACE_Player, "headBugFix"] call FUNC(unhideUnit);
|
2015-07-28 04:11:29 +00:00
|
|
|
titleCut ["", "PLAIN"];
|
2015-08-02 01:01:35 +00:00
|
|
|
true
|