mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cookoff - Limit maximum cook intensity/duration (#8648)
This commit is contained in:
parent
604f169ba5
commit
f75bfd4cef
@ -16,7 +16,7 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_vehicle", "_intensity", ["_instigator", objNull], ["_smokeDelayEnabled", true], ["_ammoDetonationChance", 0], ["_detonateAfterCookoff", false], ["_fireSource", ""], ["_canRing", true]];
|
||||
params ["_vehicle", "_intensity", ["_instigator", objNull], ["_smokeDelayEnabled", true], ["_ammoDetonationChance", 0], ["_detonateAfterCookoff", false], ["_fireSource", ""], ["_canRing", true], ["_maxIntensity", MAX_COOKOFF_INTENSITY, [0]]];
|
||||
|
||||
if (GVAR(enable) == 0) exitWith {};
|
||||
if !(GVAR(enableFire)) exitWith {};
|
||||
@ -25,11 +25,14 @@ if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [0, false]) exitWith {
|
||||
if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] isEqualTo 1 && {fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} == -1}) exitWith {};
|
||||
|
||||
|
||||
TRACE_8("cooking off",_vehicle,_intensity,_instigator,_smokeDelayEnabled,_ammoDetonationChance,_detonateAfterCookoff,_fireSource,_canRing);
|
||||
TRACE_9("cooking off",_vehicle,_intensity,_instigator,_smokeDelayEnabled,_ammoDetonationChance,_detonateAfterCookoff,_fireSource,_canRing,_maxIntensity);
|
||||
|
||||
if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {};
|
||||
_vehicle setVariable [QGVAR(isCookingOff), true, true];
|
||||
|
||||
// limit maximum value of intensity to prevent very long cook-off times
|
||||
_intensity = _intensity min _maxIntensity;
|
||||
|
||||
private _config = _vehicle call CBA_fnc_getObjectConfig;
|
||||
private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {!((_vehicle selectionPosition _x) isEqualTo [0,0,0])};
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#define MIN_TIME_BETWEEN_FLAMES 5
|
||||
#define MAX_TIME_BETWEEN_FLAMES 15
|
||||
#define MAX_TIME_BETWEEN_AMMO_DET 25
|
||||
#define MAX_COOKOFF_INTENSITY 10
|
||||
|
||||
// Delay between flame effect for players in a cooking off vehicle
|
||||
#define FLAME_EFFECT_DELAY 0.4
|
||||
|
Loading…
Reference in New Issue
Block a user