2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-14 15:49:10 +00:00
|
|
|
/*
|
2023-08-16 23:18:01 +00:00
|
|
|
* Author: tcvm
|
2021-10-14 15:49:10 +00:00
|
|
|
* Handles various fire objects and determines if local units deserves to get burned.
|
|
|
|
* Used to handle external burning objects, not used internally because internal methods are more performant.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit on fire <OBJECT>
|
|
|
|
* 1: PFH Handle <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2023-11-08 18:00:05 +00:00
|
|
|
* [ace_fire_fnc_fireManagerPFH, 0.25, [_unit]] call CBA_fnc_addPerFrameHandler
|
2021-10-14 15:49:10 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_args", "_handle"];
|
|
|
|
|
|
|
|
[GVAR(fireSources), {
|
|
|
|
_value params ["", "", "", "_condition", "_conditionArgs"];
|
|
|
|
_conditionArgs call _condition;
|
|
|
|
}] call CBA_fnc_hashFilter;
|
|
|
|
|
|
|
|
[GVAR(fireSources), {
|
|
|
|
_value params ["_source", "_radius", "_intensity"];
|
|
|
|
private _attachedObject = attachedTo _source;
|
|
|
|
private _sourcePos = getPosATL _source;
|
2021-12-18 23:15:32 +00:00
|
|
|
if (_attachedObject isNotEqualTo objNull) then {
|
2021-10-14 15:49:10 +00:00
|
|
|
_sourcePos = getPosATL _attachedObject;
|
|
|
|
};
|
2021-10-30 21:42:03 +00:00
|
|
|
|
2021-10-14 15:49:10 +00:00
|
|
|
private _nearEntities = _sourcePos nearEntities ["Man", _radius];
|
|
|
|
{
|
|
|
|
private _burning = [_x] call FUNC(isBurning);
|
|
|
|
if !(_burning) then {
|
|
|
|
private _distancePercent = 1 - ((_sourcePos distance _x) / _radius);
|
|
|
|
[QGVAR(burn), [_x, _intensity * _distancePercent]] call CBA_fnc_globalEvent;
|
|
|
|
};
|
|
|
|
} forEach _nearEntities;
|
|
|
|
}] call CBA_fnc_hashEachPair;
|