diff --git a/config.cpp b/config.cpp index a992284..6355467 100644 --- a/config.cpp +++ b/config.cpp @@ -34,11 +34,11 @@ class CfgMods class defs { - class gameScriptModule - { - value = ""; - files[] = { "YALootBoxes/scripts/4_World" }; - }; + // 4_World code (PlayerBase, Container_Base, ActionContinuousBase, + // ActionData, etc.) must load ONLY into the World script module. + // Binding it to gameScriptModule too forces it to compile inside + // 3_Game - where those World types don't exist yet - which is what + // produced all the "Unknown type" errors and aborted the server. class worldScriptModule { value = ""; diff --git a/scripts/4_World/YALootBoxes_Config.c b/scripts/4_World/YALootBoxes_Config.c index 3244409..044ad74 100644 --- a/scripts/4_World/YALootBoxes_Config.c +++ b/scripts/4_World/YALootBoxes_Config.c @@ -186,7 +186,9 @@ class YALB_ConfigLoader // Parsed-once numeric mirror of MainConfig.DebugLogLevel (see YALB_LogLevel). // Defaults to INFO so logging behaves sanely before LoadAll() runs. - static int LogLevel = YALB_LogLevel.INFO; + // NB: named ActiveLogLevel, not LogLevel - a loaded framework + // (CommunityFramework/DabsFramework) already defines a type 'LogLevel'. + static int ActiveLogLevel = YALB_LogLevel.INFO; static void EnsureDirectoryExists() { @@ -212,7 +214,7 @@ class YALB_ConfigLoader } // Parse the configured level NOW so every log below honours it. - LogLevel = YALB_ParseLogLevel(MainConfig.DebugLogLevel); + ActiveLogLevel = YALB_ParseLogLevel(MainConfig.DebugLogLevel); if (!mainConfigExisted) Log_Info("main_config.json not found - created with defaults."); @@ -322,7 +324,7 @@ int YALB_ParseLogLevel(string raw) // Shared gate + format for the non-error levels. void YALB_Emit(int level, string tag, string msg) { - if (YALB_ConfigLoader.LogLevel < level) + if (YALB_ConfigLoader.ActiveLogLevel < level) return; Print("[YALootBoxes][" + tag + "] " + msg); } @@ -331,7 +333,7 @@ void YALB_Emit(int level, string tag, string msg) // addition to honouring the level gate. (ErrorEx is standard DayZ API.) void Log_Error(string msg) { - if (YALB_ConfigLoader.LogLevel < YALB_LogLevel.ERROR) + if (YALB_ConfigLoader.ActiveLogLevel < YALB_LogLevel.ERROR) return; ErrorEx("[YALootBoxes][ERROR] " + msg); }