From e39959767822880d8f89d6c0b694d151c12ce4b9 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 6 Nov 2016 12:24:00 +0000 Subject: [PATCH] Clean some cook off code - Use unary `createVehicle` syntax - Removed some parenthesis - Simpify 3den property condition --- addons/cookoff/CfgEden.hpp | 2 +- addons/cookoff/functions/fnc_detonateAmmunition.sqf | 10 +++++----- addons/cookoff/functions/fnc_secondaryExplosions.sqf | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index 55e9b6d8b8..aa550a9228 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -11,7 +11,7 @@ class Cfg3DEN { tooltip = CSTRING(enable_tooltip); expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); typeName = "BOOL"; - condition = "objectVehicle + objectHasInventoryCargo"; + condition = "objectHasInventoryCargo"; defaultValue = "(true)"; // fix pbo project preprocessing bug }; }; diff --git a/addons/cookoff/functions/fnc_detonateAmmunition.sqf b/addons/cookoff/functions/fnc_detonateAmmunition.sqf index 5a29bf4f8a..d7d7114e7d 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunition.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunition.sqf @@ -37,7 +37,7 @@ if (_amountOfMagazines > 0) exitWith { _timeBetweenAmmoDetonation = _timeBetweenAmmoDetonation max 0.1; private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "ammo"); - private _ammoCfg = (configFile >> "CfgAmmo" >> _ammo); + private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; private _speedOfAmmo = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "initSpeed"); private _simulationTime = getNumber (_ammoCfg >> "simulation"); @@ -53,8 +53,8 @@ if (_amountOfMagazines > 0) exitWith { if (_spawnPos select 2 < 0) then { _spawnPos set [2, 0]; }; - private _projectile = _ammo createVehicle [0,0,0]; - _projectile setPos _spawnPos; + + private _projectile = createVehicle [_ammo, _spawnPos, [], 0, "CAN_COLLIDE"]; if (_flyAway) then { private _vectorAmmo = [(-1 + (random 2)), (-1 + (random 2)), -0.2 + (random 1)]; private _velVec = _vectorAmmo vectorMultiply _speed; @@ -99,7 +99,7 @@ if (_amountOfMagazines > 0) exitWith { [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; } else { - "ACE_ammoExplosionLarge" createvehicle (_vehicle modelToWorld _effect2pos); + createvehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; }; }; if (toLower _simType in ["shotdirectionalbomb", "shotmine"]) then { @@ -114,7 +114,7 @@ if (_amountOfMagazines > 0) exitWith { if (_ammo != "") then { [_vehicle, _ammo, 0, false] call _spawnProjectile; } else { - "SmallSecondary" createvehicle (_vehicle modelToWorld _effect2pos); + createvehicle ["SmallSecondary", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; }; }; }; diff --git a/addons/cookoff/functions/fnc_secondaryExplosions.sqf b/addons/cookoff/functions/fnc_secondaryExplosions.sqf index 01a2fa3b3f..34a1d28ea8 100644 --- a/addons/cookoff/functions/fnc_secondaryExplosions.sqf +++ b/addons/cookoff/functions/fnc_secondaryExplosions.sqf @@ -44,7 +44,7 @@ private _fnc_secondaryExplosion = { private _position = _vehicle modelToWorld (_vehicle selectionPosition "destructionEffect2"); // these CfgAmmo objects are always global - "SmallSecondary" createVehicle _position; + createVehicle ["SmallSecondary", _position, [], 0, "CAN_COLLIDE"]; DEC(_amount);