From 8d009d6366a0717324c2a4d60caf7b6d3ed8fb77 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 6 Dec 2021 15:15:46 +0100 Subject: [PATCH] Some false values seem to be in need of being set explicitly --- Moose Development/Moose/Core/Set.lua | 3 ++- Moose Development/Moose/Utilities/Utils.lua | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 739e8714f..adf56da93 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -209,7 +209,8 @@ do -- SET_BASE function SET_BASE:Remove( ObjectName, NoTriggerEvent ) self:F2( { ObjectName = ObjectName } ) - local TriggerEvent = NoTriggerEvent==nil and true or (not NoTriggerEvent) + local TriggerEvent = true + if NoTriggerEvent == false then TriggerEvent = false end local Object = self.Set[ObjectName] diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index e66f5b57f..ea55e3357 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -2091,7 +2091,8 @@ end -- @param #boolean Reduce If false, existing loaded groups will not be reduced to fit the saved number. -- @return #table Table of data objects (tables) containing groupname, coordinate and group object. Returns nil when file cannot be read. function UTILS.LoadStationaryListOfGroups(Path,Filename,Reduce) - local reduce = Reduce==false and false or true + local reduce = true + if Reduce == false then reduce = false end local filename = Filename or "StateListofGroups" local datatable = {} if UTILS.CheckFileExists(Path,filename) then @@ -2137,7 +2138,9 @@ end -- @return Core.Set#SET_GROUP Set of GROUP objects. -- Returns nil when file cannot be read. Returns a table of data entries if Spawn is false: `{ groupname=groupname, size=size, coordinate=coordinate }` function UTILS.LoadSetOfGroups(Path,Filename,Spawn) - local spawn = Spawn==false and false or true + local spawn = true + if Spawn == false then spawn = false end + BASE:I("Spawn = "..tostring(spawn)) local filename = Filename or "SetOfGroups" local setdata = SET_GROUP:New() local datatable = {} @@ -2223,7 +2226,8 @@ end -- @return #table Table of data objects (tables) containing staticname, size (0=dead else 1), coordinate and the static object. -- Returns nil when file cannot be read. function UTILS.LoadStationaryListOfStatics(Path,Filename,Reduce) - local reduce = Reduce==false and false or true + local reduce = true + if Reduce == false then reduce = false end local filename = Filename or "StateListofStatics" local datatable = {} if UTILS.CheckFileExists(Path,filename) then