From 590d16d12939478784751fb4a9deb29d983f5aa1 Mon Sep 17 00:00:00 2001 From: Matt Wagner Date: Sat, 16 Oct 2021 15:02:59 -0700 Subject: [PATCH] Fix repetitive 'loaded comlinks' message when getting unrelated character updates over GMCP --- mfile | 2 +- src/scripts/comlink-info/comlink-info.lua | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mfile b/mfile index ea971bb..959cd12 100644 --- a/mfile +++ b/mfile @@ -1,4 +1,4 @@ { "package": "lotj-ui", - "version": "v2.3.0" + "version": "v2.3.1" } \ No newline at end of file diff --git a/src/scripts/comlink-info/comlink-info.lua b/src/scripts/comlink-info/comlink-info.lua index 7c95a21..92a7fb0 100644 --- a/src/scripts/comlink-info/comlink-info.lua +++ b/src/scripts/comlink-info/comlink-info.lua @@ -19,12 +19,18 @@ end function lotj.comlinkInfo.loadForChar() local charName = gmcpVarByPath("Char.Info.name") if charName and io.exists(getMudletHomeDir() .. "/comlinkdata_" .. charName .. ".lua") then + if charName == lotj.comlinkInfo.currentChar then + return + end + table.load(getMudletHomeDir() .. "/comlinkdata_" .. charName .. ".lua", lotj.comlinkInfo.comlinks) if lotj.comlinkInfo.comlinks then local comlinkCount = 0 for _, _ in pairs(lotj.comlinkInfo.comlinks) do comlinkCount = comlinkCount+1 end + + lotj.comlinkInfo.currentChar = charName lotj.comlinkInfo.log("Loaded data for "..comlinkCount.." comlinks.") end end