Fix repetitive 'loaded comlinks' message when getting unrelated character updates over GMCP
This commit is contained in:
parent
5e17bf9101
commit
590d16d129
2
mfile
2
mfile
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"package": "lotj-ui",
|
"package": "lotj-ui",
|
||||||
"version": "v2.3.0"
|
"version": "v2.3.1"
|
||||||
}
|
}
|
@ -19,12 +19,18 @@ end
|
|||||||
function lotj.comlinkInfo.loadForChar()
|
function lotj.comlinkInfo.loadForChar()
|
||||||
local charName = gmcpVarByPath("Char.Info.name")
|
local charName = gmcpVarByPath("Char.Info.name")
|
||||||
if charName and io.exists(getMudletHomeDir() .. "/comlinkdata_" .. charName .. ".lua") then
|
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)
|
table.load(getMudletHomeDir() .. "/comlinkdata_" .. charName .. ".lua", lotj.comlinkInfo.comlinks)
|
||||||
if lotj.comlinkInfo.comlinks then
|
if lotj.comlinkInfo.comlinks then
|
||||||
local comlinkCount = 0
|
local comlinkCount = 0
|
||||||
for _, _ in pairs(lotj.comlinkInfo.comlinks) do
|
for _, _ in pairs(lotj.comlinkInfo.comlinks) do
|
||||||
comlinkCount = comlinkCount+1
|
comlinkCount = comlinkCount+1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
lotj.comlinkInfo.currentChar = charName
|
||||||
lotj.comlinkInfo.log("Loaded data for "..comlinkCount.." comlinks.")
|
lotj.comlinkInfo.log("Loaded data for "..comlinkCount.." comlinks.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user