mirror of
https://github.com/edubart/otclient.git
synced 2025-06-16 07:14:29 +02:00
Fix an issue with the VIP list data not being stored properly (#1083)
The VIP IDs aren't guaranteed to be stable.
This commit is contained in:
parent
307a618591
commit
b0a73e5525
@ -148,9 +148,9 @@ function createEditWindow(widget)
|
||||
g_game.editVip(id, description, iconId, notify)
|
||||
else
|
||||
if notify ~= false or #description > 0 or iconId > 0 then
|
||||
vipInfo[id] = {description = description, iconId = iconId, notifyLogin = notify}
|
||||
vipInfo[name] = {description = description, iconId = iconId, notifyLogin = notify}
|
||||
else
|
||||
vipInfo[id] = nil
|
||||
vipInfo[name] = nil
|
||||
end
|
||||
end
|
||||
|
||||
@ -203,10 +203,11 @@ function removeVip(widgetOrName)
|
||||
|
||||
if widget then
|
||||
local id = widget:getId():sub(4)
|
||||
local name = widget:getText()
|
||||
g_game.removeVip(id)
|
||||
vipList:removeChild(widget)
|
||||
if vipInfo[id] and g_game.getFeature(GameAdditionalVipInfo) then
|
||||
vipInfo[id] = nil
|
||||
if vipInfo[name] and g_game.getFeature(GameAdditionalVipInfo) then
|
||||
vipInfo[name] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -252,7 +253,7 @@ function onAddVip(id, name, state, description, iconId, notify)
|
||||
label:setText(name)
|
||||
|
||||
if not g_game.getFeature(GameAdditionalVipInfo) then
|
||||
local tmpVipInfo = vipInfo[tostring(id)]
|
||||
local tmpVipInfo = vipInfo[name]
|
||||
label.iconId = 0
|
||||
label.notifyLogin = false
|
||||
if tmpVipInfo then
|
||||
|
Loading…
x
Reference in New Issue
Block a user