mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical - optimize handle damage caching (#6657)
* optimize handle damage caching * delete some rogue code * it was 2 all along * add calls
This commit is contained in:
parent
25b6e73985
commit
8541716bee
@ -78,11 +78,10 @@ if (_unit getVariable [QGVAR(isFalling), false]) then {
|
||||
if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) then {
|
||||
_unit setVariable [QGVAR(frameNo_damageCaching), diag_frameno];
|
||||
|
||||
// handle the cached damages 3 frames later
|
||||
// handle the cached damages 2 frames later
|
||||
[{
|
||||
params ["_args", "_idPFH"];
|
||||
_args params ["_unit", "_frameno"];
|
||||
if (diag_frameno >= _frameno + 2) then {
|
||||
[{
|
||||
params ["_unit"];
|
||||
_unit setDamage 0;
|
||||
private _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []];
|
||||
private _cache_damages = _unit getVariable QGVAR(cachedDamages);
|
||||
@ -90,9 +89,8 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t
|
||||
(_x + [_cache_damages select _forEachIndex]) call FUNC(handleDamage_advanced);
|
||||
} forEach _cache_params;
|
||||
[_unit] call FUNC(handleDamage_advancedSetDamage);
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler;
|
||||
}, _this] call CBA_fnc_execNextFrame;
|
||||
}, _unit] call CBA_fnc_execNextFrame;
|
||||
|
||||
_unit setVariable [QGVAR(cachedProjectiles), []];
|
||||
_unit setVariable [QGVAR(cachedHitPoints), []];
|
||||
|
Loading…
Reference in New Issue
Block a user