bashermens
2026-01-23 12:26:24 +01:00
committed by GitHub
parent 34bab48dd4
commit a5bd0b9a41
2 changed files with 34 additions and 12 deletions

View File

@@ -62,17 +62,25 @@ bool MountDrakeAction::Execute(Event event)
break;
}
GuidVector members = AI_VALUE(GuidVector, "group members");
for (auto& member : members)
std::vector<Player*> players = botAI->GetPlayersInGroup();
for (Player* player : players)
{
Player* player = botAI->GetPlayer(member);
if (!player->GetSession()->IsBot()) { continue; }
if (!player || !player->IsInWorld() || player->IsDuringRemoveFromWorld())
continue;
for (int i = 0; i < composition.size(); i++)
WorldSession* session = player->GetSession();
if (!session || !session->IsBot())
continue;
int slot = botAI->GetGroupSlotIndex(player);
if (slot < 0)
continue;
for (uint8 i = 0; i < composition.size(); ++i)
{
if (composition[i] > 0)
{
drakeAssignments[botAI->GetGroupSlotIndex(player)] = DRAKE_ITEMS[i];
drakeAssignments[slot] = DRAKE_ITEMS[i];
composition[i]--;
break;
}