mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Explosives - Only add "detonate all" action for dead man switch when necessary (#10146)
Only add detonate all when necessary
This commit is contained in:
parent
e99d6d9381
commit
b85150e6eb
@ -92,7 +92,17 @@ if (_detonator != "ACE_DeadManSwitch") then {
|
||||
];
|
||||
};
|
||||
} else {
|
||||
//Adds actions for the explosives you can connect to the deadman switch.
|
||||
private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""];
|
||||
if ((_connectedInventoryExplosive != "") && {!(_connectedInventoryExplosive in (magazines _unit))}) then {
|
||||
TRACE_1("set, but missing in inventory",_connectedInventoryExplosive);
|
||||
_unit setVariable [QGVAR(deadmanInvExplosive), "", true];
|
||||
};
|
||||
|
||||
_connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""];
|
||||
|
||||
//Add action to detonate all explosives (including the inventory explosive):
|
||||
if (_connectedInventoryExplosive != "" || {count _explosivesList > 1}) then {
|
||||
_children pushBack [
|
||||
[
|
||||
"Explosive_All_Deadman",
|
||||
@ -104,15 +114,8 @@ if (_detonator != "ACE_DeadManSwitch") then {
|
||||
[],
|
||||
_unit
|
||||
];
|
||||
|
||||
//Adds actions for the explosives you can connect to the deadman switch.
|
||||
private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""];
|
||||
if ((_connectedInventoryExplosive != "") && {!(_connectedInventoryExplosive in (magazines _unit))}) then {
|
||||
TRACE_1("set, but missing in inventory",_connectedInventoryExplosive);
|
||||
_unit setVariable [QGVAR(deadmanInvExplosive), "", true];
|
||||
};
|
||||
|
||||
_connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""];
|
||||
if (_connectedInventoryExplosive != "") then {
|
||||
//Add the disconnect action
|
||||
private _magConfig = configFile >> "CfgMagazines" >> _connectedInventoryExplosive;
|
||||
|
Loading…
Reference in New Issue
Block a user