mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Minor tweaks and cleanup
This commit is contained in:
parent
209d3ff1b8
commit
a4968b52d7
@ -5,8 +5,8 @@
|
|||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Intensity of fire <NUMBER>
|
* 1: Fire intensity <NUMBER>
|
||||||
* 2: Instigator of fire <OBJECT> (default: objNull)
|
* 2: Fire instigator <OBJECT> (default: objNull)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -54,6 +54,11 @@ if (surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}) exitWith {
|
|||||||
|
|
||||||
// If unit is already burning, update intensity, but don't add another PFH
|
// If unit is already burning, update intensity, but don't add another PFH
|
||||||
if (_unit call FUNC(isBurning)) exitWith {
|
if (_unit call FUNC(isBurning)) exitWith {
|
||||||
|
// Only allow intensity to be increased
|
||||||
|
if (_intensity <= (_unit getVariable [QGVAR(intensity), 0])) exitWith {
|
||||||
|
TRACE_2("unit already burning, no intensity update",_unit,_intensity);
|
||||||
|
};
|
||||||
|
|
||||||
TRACE_2("unit already burning, updating intensity",_unit,_intensity);
|
TRACE_2("unit already burning, updating intensity",_unit,_intensity);
|
||||||
|
|
||||||
_unit setVariable [QGVAR(intensity), _intensity, true];
|
_unit setVariable [QGVAR(intensity), _intensity, true];
|
||||||
@ -63,7 +68,7 @@ TRACE_2("setting unit ablaze",_unit,_intensity);
|
|||||||
|
|
||||||
_unit setVariable [QGVAR(intensity), _intensity, true];
|
_unit setVariable [QGVAR(intensity), _intensity, true];
|
||||||
|
|
||||||
// Fire simulation (objects are handled differently)
|
// Fire simulation (fire sources are handled differently)
|
||||||
[QGVAR(burnSimulation), [_unit, _instigator], _unit] call CBA_fnc_targetEvent;
|
[QGVAR(burnSimulation), [_unit, _instigator], _unit] call CBA_fnc_targetEvent;
|
||||||
|
|
||||||
// Spawn effects for unit
|
// Spawn effects for unit
|
||||||
|
@ -76,7 +76,7 @@ if (isServer) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Display burn indicators
|
// Display burn indicators
|
||||||
if (_unit == ACE_player && {alive _unit} && {isNil {_unit getVariable QGVAR(burnUIPFH)}}) then { // this accounts for player remote controlled a new unit
|
if (_unit == ACE_player && {alive _unit} && {isNil {_unit getVariable QGVAR(burnUIPFH)}}) then { // This accounts for player remote controlled a new unit
|
||||||
private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler;
|
private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler;
|
||||||
_unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH];
|
_unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH];
|
||||||
};
|
};
|
||||||
@ -120,7 +120,7 @@ if (isServer) then {
|
|||||||
_fireParticle setParticleRandom [
|
_fireParticle setParticleRandom [
|
||||||
0.04 * _intensity, // life time
|
0.04 * _intensity, // life time
|
||||||
[0.05, 0.05, 2], // position
|
[0.05, 0.05, 2], // position
|
||||||
[0.05 * _intensity, 0.05 * _intensity, 0.05 * _intensity], // move velocity
|
[0.05, 0.05, 0.05] vectorMultiply _intensity, // move velocity
|
||||||
0, // rotation velocity
|
0, // rotation velocity
|
||||||
0.06 * _intensity, // size
|
0.06 * _intensity, // size
|
||||||
[0, 0, 0, 0], // color
|
[0, 0, 0, 0], // color
|
||||||
|
@ -164,6 +164,6 @@ params ["_unit", "_instigator"];
|
|||||||
// Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive
|
// Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive
|
||||||
[QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent;
|
[QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent;
|
||||||
|
|
||||||
_unit setVariable [QGVAR(intensity), _intensity, true]; // globally sync intensity across all clients to make sure simulation is deterministic
|
_unit setVariable [QGVAR(intensity), _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic
|
||||||
};
|
};
|
||||||
}, BURN_PROPAGATE_UPDATE, [_unit, _instigator]] call CBA_fnc_addPerFrameHandler;
|
}, BURN_PROPAGATE_UPDATE, [_unit, _instigator]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
Loading…
Reference in New Issue
Block a user