Fix throwing from map screen - global XEH (#4449)

* Fix throwing from map screen - global XEH

* Fix Capitalization
This commit is contained in:
PabstMirror 2016-09-23 12:48:25 -05:00 committed by GitHub
parent b7dfdc6c84
commit f23e5d33fc
2 changed files with 11 additions and 4 deletions

View File

@ -12,6 +12,6 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient));
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -1,5 +1,8 @@
#include "script_component.hpp"
// Fired XEH
[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
// Exit on HC
if (!hasInterface) exitWith {};
@ -63,6 +66,13 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
[_this select 1, "Player changed"] call FUNC(exitThrowMode);
}] call CBA_fnc_addPlayerEventhandler;
["visibleMap", {
if (visibleMap && {ACE_player getVariable [QGVAR(inHand), false]}) then {
[ACE_player, "Opened Map"] call FUNC(exitThrowMode);
};
}] call CBA_fnc_addPlayerEventhandler;
["ace_interactMenuOpened", {
// Exit if advanced throwing is disabled (pick up only supports advanced throwing)
if (!GVAR(enabled)) exitWith {};
@ -80,9 +90,6 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace;
}] call CBA_fnc_addEventHandler;
// Fired XEH
[QGVAR(throwFiredXEH), FUNC(throwFiredXEH)] call CBA_fnc_addEventHandler;
// Set last thrown time on Vanilla Throwing and Advanced Throwing
["ace_firedPlayer", {
if (_weapon == "Throw") then {