Merge pull request #2124 from kadeshar/oculus-drake-fix

Oculus drake mounting fix
This commit is contained in:
kadeshar
2026-02-08 17:10:18 +01:00
committed by GitHub
3 changed files with 32 additions and 7 deletions

View File

@@ -62,7 +62,7 @@ bool MountDrakeAction::Execute(Event event)
break; break;
} }
std::vector<Player*> players = botAI->GetPlayersInGroup(); std::vector<Player*> players = botAI->GetAllPlayersInGroup();
for (Player* player : players) for (Player* player : players)
{ {
if (!player || !player->IsInWorld() || player->IsDuringRemoveFromWorld()) if (!player || !player->IsInWorld() || player->IsDuringRemoveFromWorld())

View File

@@ -2584,7 +2584,7 @@ std::string PlayerbotAI::GetLocalizedGameObjectName(uint32 entry)
return name; return name;
} }
std::vector<Player*> PlayerbotAI::GetPlayersInGroup() std::vector<Player*> PlayerbotAI::GetRealPlayersInGroup()
{ {
std::vector<Player*> members; std::vector<Player*> members;
@@ -2611,6 +2611,30 @@ std::vector<Player*> PlayerbotAI::GetPlayersInGroup()
return members; return members;
} }
std::vector<Player*> PlayerbotAI::GetAllPlayersInGroup()
{
std::vector<Player*> members;
Group* group = bot->GetGroup();
if (!group)
return members;
for (GroupReference* ref = group->GetFirstMember(); ref; ref = ref->next())
{
Player* member = ref->GetSource();
if (!member)
{
continue;
}
members.push_back(ref->GetSource());
}
return members;
}
bool PlayerbotAI::SayToGuild(const std::string& msg) bool PlayerbotAI::SayToGuild(const std::string& msg)
{ {
if (msg.empty()) if (msg.empty())
@@ -2719,9 +2743,9 @@ bool PlayerbotAI::SayToParty(const std::string& msg)
ChatHandler::BuildChatPacket(data, CHAT_MSG_PARTY, msg.c_str(), LANG_UNIVERSAL, CHAT_TAG_NONE, bot->GetGUID(), ChatHandler::BuildChatPacket(data, CHAT_MSG_PARTY, msg.c_str(), LANG_UNIVERSAL, CHAT_TAG_NONE, bot->GetGUID(),
bot->GetName()); bot->GetName());
for (auto reciever : GetPlayersInGroup()) for (auto receiver : GetRealPlayersInGroup())
{ {
ServerFacade::instance().SendPacket(reciever, &data); ServerFacade::instance().SendPacket(receiver, &data);
} }
return true; return true;
@@ -2736,9 +2760,9 @@ bool PlayerbotAI::SayToRaid(const std::string& msg)
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, msg.c_str(), LANG_UNIVERSAL, CHAT_TAG_NONE, bot->GetGUID(), ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, msg.c_str(), LANG_UNIVERSAL, CHAT_TAG_NONE, bot->GetGUID(),
bot->GetName()); bot->GetName());
for (auto reciever : GetPlayersInGroup()) for (auto receiver : GetRealPlayersInGroup())
{ {
ServerFacade::instance().SendPacket(reciever, &data); ServerFacade::instance().SendPacket(receiver, &data);
} }
return true; return true;

View File

@@ -446,7 +446,8 @@ public:
GameObject* GetGameObject(ObjectGuid guid); GameObject* GetGameObject(ObjectGuid guid);
// static GameObject* GetGameObject(GameObjectData const* gameObjectData); // static GameObject* GetGameObject(GameObjectData const* gameObjectData);
WorldObject* GetWorldObject(ObjectGuid guid); WorldObject* GetWorldObject(ObjectGuid guid);
std::vector<Player*> GetPlayersInGroup(); std::vector<Player*> GetAllPlayersInGroup();
std::vector<Player*> GetRealPlayersInGroup();
const AreaTableEntry* GetCurrentArea(); const AreaTableEntry* GetCurrentArea();
const AreaTableEntry* GetCurrentZone(); const AreaTableEntry* GetCurrentZone();
static std::string GetLocalizedAreaName(const AreaTableEntry* entry); static std::string GetLocalizedAreaName(const AreaTableEntry* entry);