mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Handle kileld and disconnect while sitting
This commit is contained in:
parent
5bfa2425bb
commit
51e83ba0fa
@ -4,9 +4,16 @@ class Extended_PreInit_EventHandlers {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Extended_PostInit_EventHandlers {
|
class Extended_PostInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Extended_Killed_EventHandlers {
|
||||||
|
class CAManBase {
|
||||||
|
class ADDON {
|
||||||
|
killed = QUOTE(_this call DFUNC(handleInterrupt));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
// Add interaction menu exception
|
||||||
["isNotSitting", {!((_this select 0) getVariable [QGVAR(isSitting), false])}] call EFUNC(common,addCanInteractWithCondition);
|
["isNotSitting", {!((_this select 0) getVariable [QGVAR(isSitting), false])}] call EFUNC(common,addCanInteractWithCondition);
|
||||||
|
|
||||||
|
// Handle falling unconscious
|
||||||
|
["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler);
|
||||||
|
@ -5,6 +5,7 @@ ADDON = false;
|
|||||||
PREP(canSit);
|
PREP(canSit);
|
||||||
PREP(canStand);
|
PREP(canStand);
|
||||||
PREP(getRandomAnimation);
|
PREP(getRandomAnimation);
|
||||||
|
PREP(handleInterrupt);
|
||||||
PREP(moduleInit);
|
PREP(moduleInit);
|
||||||
PREP(sit);
|
PREP(sit);
|
||||||
PREP(stand);
|
PREP(stand);
|
||||||
|
24
addons/sitting/functions/fnc_handleInterrupt.sqf
Normal file
24
addons/sitting/functions/fnc_handleInterrupt.sqf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jonpas
|
||||||
|
* Handles interruptions of sitting, like killed or unconsciousness.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Player <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [player] call ace_sitting_fnc_handleInterrupt;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
PARAMS_1(_player);
|
||||||
|
|
||||||
|
if (_player getVariable [QGVAR(isSitting), false]) then {
|
||||||
|
_player setVariable [QGVAR(isSitting), nil];
|
||||||
|
GVAR(seat) setVariable [QGVAR(seatOccupied), nil, true];
|
||||||
|
QGVAR(seat) = nil;
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user