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>
This commit is contained in:
Blutze 2020-04-19 18:30:02 +02:00 committed by GitHub
parent ab989d4c34
commit 217ccce465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {
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);
};
};
};