CustomNames

CustomNames

146 Downloads

Name_Update callback does not print correct old custom name

gizzmo opened this issue ยท 1 comments

commented

Description

When changing a custom name, the callback Name_Update doesn't print the old custom name.

[07:22] Added: Xitnuh-AlteracMountains is now Renamed to First 
[07:22] Edited: Xitnuh-AlteracMountains is now Renamed to Second (was Second) 
[07:22] Edited: Xitnuh-AlteracMountains is now Renamed to Third (was Third)

This is due to the following lines changing the DB value before passing that new DB value to the callback.

CustomNames/API.lua

Lines 131 to 132 in 8cf1fb4

CharDB[name] = customName
lib.callbacks:Fire("Name_Update", name, customName, CharDB[name])

CustomNames/API.lua

Lines 93 to 96 in 8cf1fb4

BnetDB[btag].name = customName
for charname in pairs (BnetDB[btag].chars) do
lib.callbacks:Fire("Name_Update", charname, customName, BnetDB[btag].name)
end

World of Warcraft Flavor

Retail (Default)

Lua Error

No response

Reproduction Steps

  1. /cn add Xitnuh-AlteracMountains to First
  2. /cn edit Xitnuh-AlteracMountains to Second
  3. /cn edit Xitnuh-AlteracMountains to Third

Last Good Version

No response

commented

Thanks! nice catch fixed in next version