feat: fire PLAYER_UPDATE_RESTING event on rest state changes

Fire PLAYER_UPDATE_RESTING when the player enters or leaves a resting
area (inn/capital city). Fires from both the SET_REST_START packet and
the QUEST_FORCE_REMOVE rest-state update path. Used by XP bar addons
and rest state indicator addons.
This commit is contained in:
Kelsi 2026-03-21 03:27:09 -07:00
parent e64f9f4585
commit b2826ce589

View file

@ -5564,6 +5564,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
isResting_ = nowResting;
addSystemChatMessage(isResting_ ? "You are now resting."
: "You are no longer resting.");
if (addonEventCallback_)
addonEventCallback_("PLAYER_UPDATE_RESTING", {});
}
break;
}
@ -6433,6 +6435,8 @@ void GameHandler::handlePacket(network::Packet& packet) {
isResting_ = (restTrigger > 0);
addSystemChatMessage(isResting_ ? "You are now resting."
: "You are no longer resting.");
if (addonEventCallback_)
addonEventCallback_("PLAYER_UPDATE_RESTING", {});
}
break;
}