mirror of
https://github.com/edubart/otclient.git
synced 2025-06-16 15:24: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)
|
g_game.editVip(id, description, iconId, notify)
|
||||||
else
|
else
|
||||||
if notify ~= false or #description > 0 or iconId > 0 then
|
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
|
else
|
||||||
vipInfo[id] = nil
|
vipInfo[name] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -203,10 +203,11 @@ function removeVip(widgetOrName)
|
|||||||
|
|
||||||
if widget then
|
if widget then
|
||||||
local id = widget:getId():sub(4)
|
local id = widget:getId():sub(4)
|
||||||
|
local name = widget:getText()
|
||||||
g_game.removeVip(id)
|
g_game.removeVip(id)
|
||||||
vipList:removeChild(widget)
|
vipList:removeChild(widget)
|
||||||
if vipInfo[id] and g_game.getFeature(GameAdditionalVipInfo) then
|
if vipInfo[name] and g_game.getFeature(GameAdditionalVipInfo) then
|
||||||
vipInfo[id] = nil
|
vipInfo[name] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -252,7 +253,7 @@ function onAddVip(id, name, state, description, iconId, notify)
|
|||||||
label:setText(name)
|
label:setText(name)
|
||||||
|
|
||||||
if not g_game.getFeature(GameAdditionalVipInfo) then
|
if not g_game.getFeature(GameAdditionalVipInfo) then
|
||||||
local tmpVipInfo = vipInfo[tostring(id)]
|
local tmpVipInfo = vipInfo[name]
|
||||||
label.iconId = 0
|
label.iconId = 0
|
||||||
label.notifyLogin = false
|
label.notifyLogin = false
|
||||||
if tmpVipInfo then
|
if tmpVipInfo then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user