Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/Playerbots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ class PlayerbotsPlayerScript : public PlayerScript
PlayerbotsPlayerScript() : PlayerScript("PlayerbotsPlayerScript", {
PLAYERHOOK_ON_LOGIN,
PLAYERHOOK_ON_AFTER_UPDATE,
PLAYERHOOK_ON_CHAT,
PLAYERHOOK_ON_CHAT_WITH_CHANNEL,
PLAYERHOOK_ON_CHAT_WITH_GROUP,
PLAYERHOOK_ON_BEFORE_CRITERIA_PROGRESS,
PLAYERHOOK_ON_BEFORE_ACHI_COMPLETE,
PLAYERHOOK_CAN_PLAYER_USE_PRIVATE_CHAT,
PLAYERHOOK_CAN_PLAYER_USE_GROUP_CHAT,
PLAYERHOOK_CAN_PLAYER_USE_GUILD_CHAT,
PLAYERHOOK_CAN_PLAYER_USE_CHANNEL_CHAT,
PLAYERHOOK_ON_GIVE_EXP,
PLAYERHOOK_ON_BEFORE_TELEPORT
}) {}
Expand Down Expand Up @@ -164,14 +164,17 @@ class PlayerbotsPlayerScript : public PlayerScript
{
botAI->HandleCommand(type, msg, player);

return false;
// hotfix; otherwise the server will crash when whispering logout
// https://github.com/mod-playerbots/mod-playerbots/pull/1838
// TODO: find the root cause and solve it. (does not happen in party chat)
if (msg == "logout")
return false;
}
}

return true;
}

void OnPlayerChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Group* group) override
bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Group* group) override
{
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
{
Expand All @@ -183,9 +186,10 @@ class PlayerbotsPlayerScript : public PlayerScript
}
}
}
return true;
}

void OnPlayerChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg) override
bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Guild* guild) override
{
if (type == CHAT_MSG_GUILD)
{
Expand All @@ -204,9 +208,10 @@ class PlayerbotsPlayerScript : public PlayerScript
}
}
}
return true;
}

void OnPlayerChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Channel* channel) override
bool OnPlayerCanUseChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Channel* channel) override
{
if (PlayerbotMgr* playerbotMgr = GET_PLAYERBOT_MGR(player))
{
Expand All @@ -217,6 +222,7 @@ class PlayerbotsPlayerScript : public PlayerScript
}

sRandomPlayerbotMgr->HandleCommand(type, msg, player);
return true;
}

bool OnPlayerBeforeAchievementComplete(Player* player, AchievementEntry const* achievement) override
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/raids/gruulslair/RaidGruulsLairHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace GruulsLairHelpers
SPELL_SPELL_SHIELD = 33054,

// Hunter
SPELL_MISDIRECTION = 34477,
SPELL_MISDIRECTION = 35079,

// Warlock
SPELL_BANISH = 18647, // Rank 2
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/raids/magtheridon/RaidMagtheridonHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace MagtheridonHelpers
SPELL_FEAR = 6215,

// Hunter
SPELL_MISDIRECTION = 34477,
SPELL_MISDIRECTION = 35079,
};

enum MagtheridonNPCs
Expand Down
Loading