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:
Kelsi 2026-03-29 19:00:54 -07:00
parent 6731e5845a
commit a2340dd702

View file

@ -2349,10 +2349,12 @@ void GameHandler::registerOpcodeHandlers() {
}
uint32_t oldLevel = serverPlayerLevel_;
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) {
if (ch.guid == playerGuid) {
ch.level = serverPlayerLevel_;
return;
break; // was 'return' — must NOT exit here or level-up notification is skipped
}
}
if (newLevel > oldLevel) {