Fixed errors in order to get explosives to load correctly without writing anything to config.

Will still need further testing once interaction is fully integrated.
This commit is contained in:
Garth L-H de Wet 2015-01-12 23:06:32 +02:00
parent 4926694bda
commit fe056f10e1
6 changed files with 34 additions and 11 deletions

View File

@ -1,11 +1,11 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) );
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_postInit.sqf) );
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
};
};

View File

@ -10,9 +10,9 @@ class CfgVehicles {
class ACE_SelfActions {
class GVAR(Explosives) {
displayName = $STR_ACE_Explosives_Menu;
condition = QUOTE( !(_player getVariable [ARR_2(QGVAR(PlantingExplosive), false)]) );
condition = QUOTE( !(_player getVariable [ARR_2('ace_explosives_PlantingExplosive', false)]) );
statement = "";
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1;
priority = 4;
icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) );
@ -21,9 +21,9 @@ class CfgVehicles {
//Sub-menu items
class ACE_Detonate {
displayName = $STR_ACE_Explosives_Detonate;
condition = QUOTE( [_player] call FUNC(hasPlacedExplosives) AND ) and {count ([_player] call FUNC(getDetonators)) > 0} );
condition = QUOTE( [_player] call FUNC(canDetonate) );
statement = QUOTE( [_player] call FUNC(openTransmitterUI); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1;
icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) );
priority = 2;
@ -33,7 +33,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Place;
condition = QUOTE( (vehicle _player == _player) and {[_player] call FUNC(hasExplosives)} );
statement = QUOTE( [_player] call FUNC(openPlaceUI); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1;
icon = QUOTE( PATHTOF(UI\Place_Explosive_ca.paa) );
priority = 1;
@ -43,7 +43,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE( [_player] call FUNC(canDefuse) );
statement = QUOTE( [ARR_2(_player, EGVAR(Interaction, Target))] call FUNC(startDefuse); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \
exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 0;
icon = QUOTE( PATHTOF(UI\Defuse_ca.paa) );
priority = 0.8;

View File

@ -20,6 +20,7 @@ None
PREP(addClacker);
PREP(canDefuse);
PREP(canDetonate);
PREP(defuseExplosive);
PREP(detonateExplosive);

View File

@ -6,9 +6,9 @@ class CfgPatches {
weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch"};
requiredVersion = 0.60;
requiredAddons[] = {ace_common, ace_interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
version = QUOTE(VERSION);
versionStr = QUOTE(VERSION);
versionAr[] = {VERSION_AR};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "http://garth.snakebiteink.co.za/";
};

View File

@ -0,0 +1,22 @@
/*
Name: ACE_Explosives_fnc_canDetonate
Author: Garth de Wet (LH)
Description:
Checks if a unit can detonate an explosive
Parameters:
0: OBJECT - unit
Returns:
BOOLEAN - if the unit has explosives and detonators.
Example:
[player] call ACE_Explosives_fnc_canDetonate;
*/
#include "\z\ace\explosives\script_component.hpp"
private "_unit";
_unit = _this select 0;
[_unit] call FUNC(hasPlacedExplosives) and {count ([_unit] call FUNC(getDetonators)) > 0}