1
0
mirror of https://github.com/acemod/ACE3.git synced 2024-08-30 18:23:18 +00:00

- Fix AI rotating while dead (disableAI func)

Still some small head movements, but I don't know how to fix that.
This commit is contained in:
PabstMirror 2015-04-10 15:02:36 -05:00
parent 2a72e183b1
commit adc7db9ae9
2 changed files with 29 additions and 15 deletions
addons
common/functions
medical/functions

@ -1,23 +1,37 @@
/**
* fn_disableAI_f.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal, KoffeinFlummi
* Disables/Enables AI
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* 0: Unit <OBJECT>
* 1: Disable AI <BOOL>
*
* Return Value:
* None
*
* Example:
* [bob, true] call ace_common_fnc_disableAI;
*
* Public: No
*/
#include "script_component.hpp"
private ["_unit","_disable"];
_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param;
_disable = [_this, 1,false,[false]] call BIS_fnc_Param;
if (local _unit && !(IsPlayer _unit)) then {
PARAMS_2(_unit,_disable);
if ((local _unit) && {!([_unit] call EFUNC(common,isPlayer))}) then {
if (_disable) then {
_unit disableAI "Move";
_unit disableAI "MOVE";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit disableAI "FSM";
_unit disableConversation true;
} else {
_unit enableAI "Move";
//Sanity check to make sure we don't enable unconsious AI
if (_unit getVariable ["ace_isunconscious", false]) exitWith {ERROR("Enabling AI for unconsious unit");};
_unit enableAI "MOVE";
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
_unit enableAI "FSM";
_unit disableConversation false;
};
};
};

@ -116,7 +116,7 @@ _startingTime = time;
// Swhich the unit back to its original group
[_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide);
[_unit, false] call EFUNC(common,disableAI_F);
[_unit, false] call EFUNC(common,disableAI);
_unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP)
_unit setUnconscious false;