mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cookoff - Remove flares from cookoff (#9146)
* Framework for removing flares * Seperate fnc and strings etc * Improvements from @mharis001 * Fix incorrect header fnc * Clean-up return * Remove setting
This commit is contained in:
parent
4997a4c102
commit
2092d4fd71
@ -7,4 +7,4 @@ PREP(cookOffEffect);
|
|||||||
PREP(cookOffBox);
|
PREP(cookOffBox);
|
||||||
PREP(detonateAmmunition);
|
PREP(detonateAmmunition);
|
||||||
PREP(getVehicleAmmo);
|
PREP(getVehicleAmmo);
|
||||||
|
PREP(isMagazineFlare);
|
||||||
|
@ -29,6 +29,7 @@ private _totalAmmo = 0;
|
|||||||
_x params ["_mag", "_turret", "_count"];
|
_x params ["_mag", "_turret", "_count"];
|
||||||
// if the turret is an FFV seat, it takes magazines from the soldier
|
// if the turret is an FFV seat, it takes magazines from the soldier
|
||||||
if (_count > 0) then {
|
if (_count > 0) then {
|
||||||
|
if (_mag call FUNC(isMagazineFlare)) then {continue};
|
||||||
private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo");
|
private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo");
|
||||||
private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model");
|
private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model");
|
||||||
if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);};
|
if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);};
|
||||||
@ -41,6 +42,7 @@ private _totalAmmo = 0;
|
|||||||
{
|
{
|
||||||
_x params ["_mag", "_count"];
|
_x params ["_mag", "_count"];
|
||||||
if (_count > 0) then {
|
if (_count > 0) then {
|
||||||
|
if (_mag call FUNC(isMagazineFlare)) then {continue};
|
||||||
_ammoToDetonate pushBack [_mag, _count];
|
_ammoToDetonate pushBack [_mag, _count];
|
||||||
_totalAmmo = _totalAmmo + _count;
|
_totalAmmo = _totalAmmo + _count;
|
||||||
};
|
};
|
||||||
|
24
addons/cookoff/functions/fnc_isMagazineFlare.sqf
Normal file
24
addons/cookoff/functions/fnc_isMagazineFlare.sqf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: Cyruz
|
||||||
|
* Checks if the magazine has ammo which is a flare
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Magazine <STRING>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* 0: If magazine is type of flare <BOOL>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* ["3Rnd_UGL_FlareWhite_F"] call ace_cookoff_fnc_isMagazineFlare
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
|
||||||
|
params ["_magazine"];
|
||||||
|
|
||||||
|
private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
|
||||||
|
private _intensity = getNumber (configFile >> "CfgAmmo" >> _ammo >> "intensity");
|
||||||
|
private _flare = getNumber (configFile >> "CfgAmmo" >> _ammo >> QEGVAR(grenades,flare));
|
||||||
|
|
||||||
|
_intensity != 0 || _flare == 1
|
Loading…
Reference in New Issue
Block a user