From 1f6f90a5b23069938e728bf350e1c22de462961e Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Mar 2016 13:59:07 +0200 Subject: [PATCH 1/2] fixerrornoname --- addons/common/CfgEventHandlers.hpp | 2 +- addons/common/functions/fnc_setName.sqf | 8 +------- addons/common/script_component.hpp | 2 ++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 2c4f3922bc..6340402639 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -33,7 +33,7 @@ class Extended_InitPost_EventHandlers { }; class CAManBase { class GVAR(setName) { - init = QUOTE(if (local (_this select 0)) then {_this call FUNC(setName)};); + init = QUOTE(if (local (_this select 0)) then {[ARR_3(FUNC(setName), _this, DELAY_SETNAME)] call FUNC(waitAndExecute)};); }; class GVAR(muteUnit) { init = QUOTE(_this call FUNC(muteUnitHandleInitPost)); diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index b9ecbdc3a6..1b2b515ec2 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -19,13 +19,7 @@ if (isNull _unit || {!alive _unit}) exitWith {}; if (_unit isKindOf "CAManBase") then { private _sanitizedName = [name _unit, true] call FUNC(sanitizeString); private _rawName = [name _unit, false] call FUNC(sanitizeString); - - //Debug Testing Code (with html tags): - // private _sanitizedName = ["Name", true] call FUNC(sanitizeString); - // private _rawName = ["Name", false] call FUNC(sanitizeString); - - //if (_name != _unit getVariable ["ACE_Name", ""]) then { + _unit setVariable ["ACE_Name", _sanitizedName, true]; _unit setVariable ["ACE_NameRaw", _rawName, true]; - //}; }; diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 4e941943fa..3b915f2c24 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -19,3 +19,5 @@ #define VERSION_CONFIG_COMMON VERSION_CONFIG;\ versionDesc = "ACE 3";\ versionAct = QUOTE(call COMPILE_FILE(init_versionTooltip)) + +#define DELAY_SETNAME 1 From 4e1b2dd24a97481bf822145c12cc20994a034459 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Mar 2016 15:32:05 +0200 Subject: [PATCH 2/2] just delay setName one frame --- addons/common/CfgEventHandlers.hpp | 2 +- addons/common/script_component.hpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 6340402639..6e8528cf03 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -33,7 +33,7 @@ class Extended_InitPost_EventHandlers { }; class CAManBase { class GVAR(setName) { - init = QUOTE(if (local (_this select 0)) then {[ARR_3(FUNC(setName), _this, DELAY_SETNAME)] call FUNC(waitAndExecute)};); + init = QUOTE(if (local (_this select 0)) then {[ARR_2(FUNC(setName),_this)] call FUNC(execNextFrame)};); }; class GVAR(muteUnit) { init = QUOTE(_this call FUNC(muteUnitHandleInitPost)); diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 3b915f2c24..4e941943fa 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -19,5 +19,3 @@ #define VERSION_CONFIG_COMMON VERSION_CONFIG;\ versionDesc = "ACE 3";\ versionAct = QUOTE(call COMPILE_FILE(init_versionTooltip)) - -#define DELAY_SETNAME 1