From 459705166b1a98de65121f59825d167c0b5e7e96 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 9 Oct 2015 08:39:16 +0200 Subject: [PATCH 1/3] posible fix for #169 --- .gitignore | 3 +++ addons/common/fnc_removePerFrameHandler.sqf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b181da3bd..12c858235 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ Thumbs.db *~ *# +addons/cache_disable/$PBOPREFIX$.TXT +addons/cache_disable/config.cpp +addons/cache_disable/script_component.hpp diff --git a/addons/common/fnc_removePerFrameHandler.sqf b/addons/common/fnc_removePerFrameHandler.sqf index c4760b964..ab82c91cf 100644 --- a/addons/common/fnc_removePerFrameHandler.sqf +++ b/addons/common/fnc_removePerFrameHandler.sqf @@ -36,8 +36,8 @@ _newArray = []; GVAR(nextPFHid) = ({ private ["_newHandle", "_return"]; _return = false; - _x params ["", "", "", "", "", "_publicH"]; if !(isNil "_x") then { + _x params ["", "", "", "", "", "_publicH"]; _newHandle = _newArray pushBack _x; GVAR(PFHhandles) set [_publicH, _newHandle]; _return = true; From ea2e6cc33398505539f2bf646cad0b624a93448e Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 9 Oct 2015 08:41:13 +0200 Subject: [PATCH 2/3] fix my local gitNore stuff --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 12c858235..77ce0e915 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,4 @@ Thumbs.db /addons/CBA_Project.sublime-workspace *~ -*# -addons/cache_disable/$PBOPREFIX$.TXT -addons/cache_disable/config.cpp -addons/cache_disable/script_component.hpp +*# \ No newline at end of file From 52d829b2c4b0af0116fe2672bfea425184e32161 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 9 Oct 2015 22:52:03 +0200 Subject: [PATCH 3/3] prevent that _x nil issue occlude in PFH Loop --- addons/common/fnc_addPerFrameHandler.sqf | 2 +- addons/common/init_perFrameHandler.sqf | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/addons/common/fnc_addPerFrameHandler.sqf b/addons/common/fnc_addPerFrameHandler.sqf index 4b59934f2..6b641c109 100644 --- a/addons/common/fnc_addPerFrameHandler.sqf +++ b/addons/common/fnc_addPerFrameHandler.sqf @@ -23,7 +23,7 @@ Author: ---------------------------------------------------------------------------- */ #include "script_component.hpp" -private["_handle", "_data", "_publicHandle"]; +private ["_handle", "_data", "_publicHandle"]; params ["_func","_delay", ["_params",[]]]; if (!isNil "_func") then { diff --git a/addons/common/init_perFrameHandler.sqf b/addons/common/init_perFrameHandler.sqf index 7d8059480..7ba261c18 100644 --- a/addons/common/init_perFrameHandler.sqf +++ b/addons/common/init_perFrameHandler.sqf @@ -127,8 +127,6 @@ FUNC(monitorFrameRender) = { FUNC(onFrame) = { TRACE_1("Executing onFrame",nil); - - private "_handlerData"; GVAR(lastFrameRender) = diag_frameNo; // if(GVAR(lastCount) > (GVAR(fpsCount)-1)) then { // hint "FUCK UP IN SEQUENCE!"; @@ -138,13 +136,14 @@ FUNC(onFrame) = { // GVAR(fpsCount) = GVAR(fpsCount) + 1; // player sideChat format["c: %1", GVAR(perFrameHandlerArray)]; { - _handlerData = _x; - if (_handlerData params ["_func", "_delay", "_delta", "", "_args", "_idPFH"]) then { - if (diag_tickTime > _delta) then { - [_args, _idPFH] call _func; - _delta = diag_tickTime + _delay; - //TRACE_1("data", _data); - _handlerData set [2, _delta]; + if !(isNil "_x") then { + if (_x params ["_func", "_delay", "_delta", "", "_args", "_idPFH"]) then { + if (diag_tickTime > _delta) then { + [_args, _idPFH] call _func; + _delta = diag_tickTime + _delay; + //TRACE_1("data", _data); + _x set [2, _delta]; + }; }; }; } count GVAR(perFrameHandlerArray);