From 217ccce4657c5a0f87aa543290d4fae95b220557 Mon Sep 17 00:00:00 2001 From: Blutze <37950828+Blutze@users.noreply.github.com> Date: Sun, 19 Apr 2020 18:30:02 +0200 Subject: [PATCH] Grenades - use correct type for cookoff_enabled, check for AI and variable on vehicle (#7634) * check for variable and ai, use correct type * clean up negations Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> --- addons/grenades/functions/fnc_incendiary.sqf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index b07ed48fb3..d454001031 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -229,7 +229,10 @@ private _enginePosition = _vehicle modelToWorld (_vehicle selectionPosition _eng if (_position distance _enginePosition < EFFECT_SIZE * 2) then { _vehicle setHit [_engineSelection, 1]; - if ("ace_cookoff" call EFUNC(common,isModLoaded) && {EGVAR(cookoff,enable)}) then { - _vehicle call EFUNC(cookoff,engineFire); + if ("ace_cookoff" call EFUNC(common,isModLoaded)) then { + private _enabled = _vehicle getVariable [QEGVAR(cookoff,enable), EGVAR(cookoff,enable)]; + if (_enabled in [2, true] || {_enabled isEqualTo 1 && {fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} != -1}}) then { + _vehicle call EFUNC(cookoff,engineFire); + }; }; };