ACE3/addons/fire/functions/fnc_burnIndicator.sqf
johnb432 f45dff8a09
Fire - Mini-Rewrite (#9757)
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-06-22 15:07:36 -03:00

41 lines
945 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: tcvm
* Run once per second in a PFH. Update screen effects with burn indicator.
*
* Arguments:
* 0: Unit on fire <OBJECT>
* 1: PFH Handle <NUMBER>
*
* Return Value:
* None
*
* Example:
* [player, _pfhID] call ace_fire_fnc_burnIndicator
*
* Public: No
*/
params ["_unit", "_pfhID"];
if (!alive _unit || {!(_unit call FUNC(isBurning))}) exitWith {
_pfhID call CBA_fnc_removePerFrameHandler;
_unit setVariable [QGVAR(burnUIPFH), nil];
};
// Don't show burn overlay if unconscious or dead
if !(_unit call EFUNC(common,isAwake)) exitWith {};
private _iteration = _unit getVariable [QGVAR(indicatorIteration), 0];
if (_iteration == 0) then {
QGVAR(indicatorLayer) cutRsc [QGVAR(onFire1), "PLAIN"];
_iteration = 1;
} else {
QGVAR(indicatorLayer) cutRsc [QGVAR(onFire2), "PLAIN"];
_iteration = 0;
};
_unit setVariable [QGVAR(indicatorIteration), _iteration];