Explosives - Fix objNull reported as source and instigator in BI handleDamage event for explosive triggered by timer (#8647)

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Vdauphin 2021-11-08 00:29:27 +01:00 committed by GitHub
parent 715da4d1bd
commit c83caa63b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -56,7 +56,7 @@ class ACE_Triggers {
isAttachable = 1;
displayName = CSTRING(timerName);
picture = QPATHTOF(data\UI\Timer.paa);
onPlace = QUOTE([ARR_2(_this select 1, _this select 3 select 0)] call FUNC(startTimer); false);
onPlace = QUOTE([ARR_4(_this select 1, _this select 3 select 0, nil, _this select 0)] call FUNC(startTimer); false);
onSetup = QUOTE(_this call FUNC(openTimerUI));
};
class Tripwire {

View File

@ -38,6 +38,6 @@ if (_unit == ace_player) then {
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75];
(_this select 0) setVariable [QGVAR(Dialing), false, true];
}, [_unit,_explosive select 0], 0.25 * (count _arr - 4)] call CBA_fnc_waitAndExecute;
[_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2), "ACE_Cellphone"] call FUNC(startTimer);
[_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2), "ACE_Cellphone", _unit] call FUNC(startTimer);
};
};

View File

@ -7,6 +7,7 @@
* 0: Explosive <OBJECT>
* 1: Time till detonate <NUMBER>
* 2: Trigger classname <STRING> (default: "#timer")
* 3: Unit <OBJECT>
*
* Return Value:
* None
@ -17,13 +18,13 @@
* Public: Yes
*/
params ["_explosive", "_delay", ["_trigger", "#timer", [""]]];
TRACE_3("Starting timer",_explosive,_delay,_trigger);
params ["_explosive", "_delay", ["_trigger", "#timer", [""]], ["_unit", objNull, [objNull]]];
TRACE_4("Starting timer",_explosive,_delay,_trigger,_unit);
[{
params ["_explosive", "_trigger"];
params ["_explosive", "_trigger", "_unit"];
TRACE_1("Explosive detonating from timer",_explosive);
if (!isNull _explosive) then {
[_explosive, -1, [_explosive, 0], _trigger] call FUNC(detonateExplosive);
[_unit, -1, [_explosive, 0], _trigger] call FUNC(detonateExplosive);
};
}, [_explosive, _trigger], _delay] call CBA_fnc_waitAndExecute;
}, [_explosive, _trigger, _unit], _delay] call CBA_fnc_waitAndExecute;