feat: fire AUTOFOLLOW_BEGIN and AUTOFOLLOW_END events

Fire AUTOFOLLOW_BEGIN when the player starts following another unit
via /follow. Fire AUTOFOLLOW_END when following is cancelled. Used by
movement addons and AFK detection addons.
This commit is contained in:
Kelsi 2026-03-21 11:45:52 -07:00
parent 1f6865afce
commit be841fb3e1

View file

@ -14148,6 +14148,7 @@ void GameHandler::followTarget() {
addSystemChatMessage("Now following " + targetName + "."); addSystemChatMessage("Now following " + targetName + ".");
LOG_INFO("Following target: ", targetName, " (GUID: 0x", std::hex, targetGuid, std::dec, ")"); LOG_INFO("Following target: ", targetName, " (GUID: 0x", std::hex, targetGuid, std::dec, ")");
if (addonEventCallback_) addonEventCallback_("AUTOFOLLOW_BEGIN", {});
} }
void GameHandler::cancelFollow() { void GameHandler::cancelFollow() {
@ -14157,6 +14158,7 @@ void GameHandler::cancelFollow() {
} }
followTargetGuid_ = 0; followTargetGuid_ = 0;
addSystemChatMessage("You stop following."); addSystemChatMessage("You stop following.");
if (addonEventCallback_) addonEventCallback_("AUTOFOLLOW_END", {});
} }
void GameHandler::assistTarget() { void GameHandler::assistTarget() {