mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
fix: level-up notification never fired — early return skipped it
The character-list level update loop used 'return' instead of 'break', exiting the handler lambda before the level-up chat message, sound effect, callback, and PLAYER_LEVEL_UP event could fire. Since the player GUID is always in the character list, the notification code was effectively dead — players never saw "You have reached level N!".
This commit is contained in:
parent
6731e5845a
commit
a2340dd702
1 changed files with 3 additions and 1 deletions
|
|
@ -2349,10 +2349,12 @@ void GameHandler::registerOpcodeHandlers() {
|
||||||
}
|
}
|
||||||
uint32_t oldLevel = serverPlayerLevel_;
|
uint32_t oldLevel = serverPlayerLevel_;
|
||||||
serverPlayerLevel_ = std::max(serverPlayerLevel_, newLevel);
|
serverPlayerLevel_ = std::max(serverPlayerLevel_, newLevel);
|
||||||
|
// Update the character-list entry so the selection screen
|
||||||
|
// shows the correct level if the player logs out and back.
|
||||||
for (auto& ch : characters) {
|
for (auto& ch : characters) {
|
||||||
if (ch.guid == playerGuid) {
|
if (ch.guid == playerGuid) {
|
||||||
ch.level = serverPlayerLevel_;
|
ch.level = serverPlayerLevel_;
|
||||||
return;
|
break; // was 'return' — must NOT exit here or level-up notification is skipped
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newLevel > oldLevel) {
|
if (newLevel > oldLevel) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue