diff --git a/src/mod_account_mount.cpp b/src/mod_account_mount.cpp index 3223641..3e84e86 100644 --- a/src/mod_account_mount.cpp +++ b/src/mod_account_mount.cpp @@ -1,7 +1,7 @@ -#include "Config.h" -#include "ScriptMgr.h" #include "Chat.h" +#include "Config.h" #include "Player.h" +#include "ScriptMgr.h" #include // Required for std::set -- might be redundant #include // Required for std::istringstream -- might be redundant #include // Required for std::string -- might be redundant @@ -12,7 +12,9 @@ class AccountMounts : public PlayerScript std::set excludedSpellIds; // Set to hold the Spell IDs to be excluded public: - AccountMounts() : PlayerScript("AccountMounts") + AccountMounts() : PlayerScript("AccountMounts", { + PLAYERHOOK_ON_LOGIN + }) { // Retrieve the string of excluded Spell IDs from the config file std::string excludedSpellsStr = sConfigMgr->GetOption("Account.Mounts.ExcludedSpellIDs", ""); @@ -21,23 +23,21 @@ public: { std::istringstream spellStream(excludedSpellsStr); std::string spellIdStr; - while (std::getline(spellStream, spellIdStr, ',')) { + while (std::getline(spellStream, spellIdStr, ',')) + { uint32 spellId = static_cast(std::stoul(spellIdStr)); - if (spellId != 0) { // Ensure the spell ID is not 0, as 0 is used to indicate no exclusions + if (spellId != 0) // Ensure the spell ID is not 0, as 0 is used to indicate no exclusions excludedSpellIds.insert(spellId); // Add the Spell ID to the set of exclusions - } } } } - void OnLogin(Player* pPlayer) + void OnPlayerLogin(Player* pPlayer) { if (sConfigMgr->GetOption("Account.Mounts.Enable", true)) { if (sConfigMgr->GetOption("Account.Mounts.Announce", false)) - { ChatHandler(pPlayer->GetSession()).SendSysMessage("This server is running the |cff4CFF00AccountMounts |rmodule."); - } std::vector Guids; uint32 playerAccountID = pPlayer->GetSession()->GetAccountId();