From ccc802fdd268546aa2bd7ed01651d79a56d37bdc Mon Sep 17 00:00:00 2001 From: Apricot <50947830+Apricot-ale@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:39:06 +0900 Subject: [PATCH] Misc - Fix PPeffect error on server at fullHealLocal (#410) **When merged this pull request will:** - _This is almost the same as this PR. https://github.com/KAT-Advanced-Medical/KAM/pull/385_ - _Add a hasInterface check to the ppEffectCreate section of fnc_fullHealLocal.sqf._ - _This will prevent error records `Post process effect creation failed` from being spammed in the server's .rpt log._ - _This error occurs when you run fullHealLocal against AI on the server (from ZEUS, etc)._ - _This error appears on dedicated servers (maybe even headless clients?). This error causes the log file to exceed 2 GB and slows down processing power due to spam._ - _This fix will also help improve the server's FPS. Reduce unnecessary work on server._ ### IMPORTANT - [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied. - Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`. --- addons/misc/functions/fnc_fullHealLocal.sqf | 51 +++++++++++---------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/addons/misc/functions/fnc_fullHealLocal.sqf b/addons/misc/functions/fnc_fullHealLocal.sqf index 50480b9b5..9a6fc04f1 100644 --- a/addons/misc/functions/fnc_fullHealLocal.sqf +++ b/addons/misc/functions/fnc_fullHealLocal.sqf @@ -175,34 +175,35 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { }; /// Clear chroma effect & camera shake - -resetCamShake; -["ChromAberration", 200, [ 0, 0, true ]] spawn -{ - params["_name", "_priority", "_effect", "_handle"]; - while - { - _handle = ppEffectCreate[_name, _priority]; - _handle < 0 - } - do +if (hasInterface) then { + resetCamShake; + ["ChromAberration", 200, [ 0, 0, true ]] spawn { - _priority = _priority + 1; - }; - _handle ppEffectEnable true; - _handle ppEffectAdjust _effect; - _handle ppEffectCommit 0; - [ + params["_name", "_priority", "_effect", "_handle"]; + while { - params["_handle"]; - ppEffectCommitted _handle - }, + _handle = ppEffectCreate[_name, _priority]; + _handle < 0 + } + do { - params["_handle"]; - _handle ppEffectEnable false; - ppEffectDestroy _handle; - }, - [_handle]] call CBA_fnc_waitUntilAndExecute; + _priority = _priority + 1; + }; + _handle ppEffectEnable true; + _handle ppEffectAdjust _effect; + _handle ppEffectCommit 0; + [ + { + params["_handle"]; + ppEffectCommitted _handle + }, + { + params["_handle"]; + _handle ppEffectEnable false; + ppEffectDestroy _handle; + }, + [_handle]] call CBA_fnc_waitUntilAndExecute; + }; }; // Reenable ace fatige animationspeed override