Explosives are now placed first and then the trigger is set afterwards.

This commit is contained in:
Garth L-H de Wet
2015-02-20 03:28:16 +02:00
parent 477d8c9dec
commit 9d1b1e1b12
10 changed files with 93 additions and 94 deletions

View File

@ -3,26 +3,27 @@
* Selects a trigger for an explosive.
*
* Arguments:
* 0: Magazine <STRING>
* 1: Trigger mode <STRING>
* 0: Explosive <OBJECT>
* 1: Magazine <STRING>
* 2: Trigger mode <STRING>
*
* Return Value:
* None
*
* Example:
* ["SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
* [_explosive, "SatchelCharge_Remote_Mag","Timer"] call ACE_Explosives_fnc_selectTrigger;
*
* Public: No
*/
#include "script_component.hpp"
private ["_magazine","_trigger"];
closeDialog 0;
_magazine = _this select 0;
_trigger = _this select 1;
_config = ConfigFile >> "CfgACE_Triggers" >> _trigger;
call EFUNC(interaction,hideMenu);
EXPLODE_3_PVT(_this,_explosive,_magazine,_trigger);
_config = ConfigFile >> "CfgACE_Triggers" >> _trigger;
GVAR(explosive) = objNull;
// If the onSetup function returns true, it is handled elsewhere
if (isText(_config >> "onSetup") && {[_magazine] call compile getText (_config >> "onSetup")}) exitWith {};
if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith {};
[ACE_player, _magazine, _trigger] call FUNC(setupExplosive);
[ACE_player, getPosATL _explosive, _explosive getVariable [QGVAR(Direction), 0],_magazine, _trigger, [], _explosive] call ACE_Explosives_fnc_placeExplosive;