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 Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); init = QUOTE( call COMPILE_FILE(XEH_preInit) );
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { 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 ACE_SelfActions {
class GVAR(Explosives) { class GVAR(Explosives) {
displayName = $STR_ACE_Explosives_Menu; 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 = ""; statement = "";
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \ exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1; showDisabled = 1;
priority = 4; priority = 4;
icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) ); icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) );
@ -21,9 +21,9 @@ class CfgVehicles {
//Sub-menu items //Sub-menu items
class ACE_Detonate { class ACE_Detonate {
displayName = $STR_ACE_Explosives_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); ); statement = QUOTE( [_player] call FUNC(openTransmitterUI); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \ exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1; showDisabled = 1;
icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) ); icon = QUOTE( PATHTOF(UI\Explosives_Menu_ca.paa) );
priority = 2; priority = 2;
@ -33,7 +33,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Place; displayName = $STR_ACE_Explosives_Place;
condition = QUOTE( (vehicle _player == _player) and {[_player] call FUNC(hasExplosives)} ); condition = QUOTE( (vehicle _player == _player) and {[_player] call FUNC(hasExplosives)} );
statement = QUOTE( [_player] call FUNC(openPlaceUI); ); statement = QUOTE( [_player] call FUNC(openPlaceUI); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \ exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 1; showDisabled = 1;
icon = QUOTE( PATHTOF(UI\Place_Explosive_ca.paa) ); icon = QUOTE( PATHTOF(UI\Place_Explosive_ca.paa) );
priority = 1; priority = 1;
@ -43,7 +43,7 @@ class CfgVehicles {
displayName = $STR_ACE_Explosives_Defuse; displayName = $STR_ACE_Explosives_Defuse;
condition = QUOTE( [_player] call FUNC(canDefuse) ); condition = QUOTE( [_player] call FUNC(canDefuse) );
statement = QUOTE( [ARR_2(_player, EGVAR(Interaction, Target))] call FUNC(startDefuse); ); statement = QUOTE( [ARR_2(_player, EGVAR(Interaction, Target))] call FUNC(startDefuse); );
exceptions[] = {"ACE_Interaction_isNotSwimming"}; \ exceptions[] = {"ACE_Interaction_isNotSwimming"};
showDisabled = 0; showDisabled = 0;
icon = QUOTE( PATHTOF(UI\Defuse_ca.paa) ); icon = QUOTE( PATHTOF(UI\Defuse_ca.paa) );
priority = 0.8; priority = 0.8;

View File

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

View File

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