Merge pull request #128 from ciribob:bugfix/BF-2025.01.04

v1.2.1 - corrected the behavior of the `ctld.dontInitialize` parameter
This commit is contained in:
David Pierron
2025-01-04 11:28:03 +01:00
committed by GitHub

View File

@@ -35,7 +35,7 @@ ctld = {} -- DONT REMOVE!
ctld.Id = "CTLD - " ctld.Id = "CTLD - "
--- Version. --- Version.
ctld.Version = "1.2.0" ctld.Version = "1.2.1"
-- To add debugging messages to dcs.log, change the following log levels to `true`; `Debug` is less detailed than `Trace` -- To add debugging messages to dcs.log, change the following log levels to `true`; `Debug` is less detailed than `Trace`
ctld.Debug = false ctld.Debug = false
@@ -7887,10 +7887,6 @@ end
-- ***************** SETUP SCRIPT **************** -- ***************** SETUP SCRIPT ****************
function ctld.initialize() function ctld.initialize()
if ctld.dontInitialize then
ctld.logInfo(string.format("Skipping initializion of version %s because ctld.dontInitialize is true", ctld.Version))
return
end
ctld.logInfo(string.format("Initializing version %s", ctld.Version)) ctld.logInfo(string.format("Initializing version %s", ctld.Version))
assert(mist ~= nil, "\n\n** HEY MISSION-DESIGNER! **\n\nMiST has not been loaded!\n\nMake sure MiST 3.6 or higher is running\n*before* running this script!\n") assert(mist ~= nil, "\n\n** HEY MISSION-DESIGNER! **\n\nMiST has not been loaded!\n\nMake sure MiST 3.6 or higher is running\n*before* running this script!\n")
@@ -8293,10 +8289,8 @@ env.setErrorMessageBoxEnabled(false)
-- initialize CTLD -- initialize CTLD
-- if you need to have a chance to modify the configuration before initialization in your other scripts, please set ctld.dontInitialize to true and call ctld.initialize() manually -- if you need to have a chance to modify the configuration before initialization in your other scripts, please set ctld.dontInitialize to true and call ctld.initialize() manually
ctld.initialize() if ctld.dontInitialize then
ctld.logInfo(string.format("Skipping initializion of version %s because ctld.dontInitialize is true", ctld.Version))
--DEBUG FUNCTION else
-- for key, value in pairs(getmetatable(_spawnedCrate)) do ctld.initialize()
-- env.info(tostring(key)) end
-- env.info(tostring(value))
-- end