Skip to content

Commit

Permalink
Fix repetitive 'loaded comlinks' message when getting unrelated chara…
Browse files Browse the repository at this point in the history
…cter updates over GMCP
  • Loading branch information
rengawm committed Oct 16, 2021
1 parent 5e17bf9 commit 590d16d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"package": "lotj-ui",
"version": "v2.3.0"
"version": "v2.3.1"
}
6 changes: 6 additions & 0 deletions src/scripts/comlink-info/comlink-info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 590d16d

Please sign in to comment.