mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
feat(Core/Script): Hooks for custom arena teams/types (#3508)
This commit is contained in:
@@ -51,7 +51,30 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) co
|
||||
std::string teamName = itr->second->GetName();
|
||||
std::transform(teamName.begin(), teamName.end(), teamName.begin(), ::toupper);
|
||||
if (search == teamName)
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(std::string const& arenaTeamName, const uint32 type) const
|
||||
{
|
||||
std::string search = arenaTeamName;
|
||||
std::transform(search.begin(), search.end(), search.begin(), ::toupper);
|
||||
for (auto itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second->GetType() != type)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
std::string teamName = itr->second->GetName();
|
||||
std::transform(teamName.begin(), teamName.end(), teamName.begin(), ::toupper);
|
||||
if (search == teamName)
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -59,9 +82,25 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) co
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid) const
|
||||
{
|
||||
for (ArenaTeamContainer::const_iterator itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second->GetCaptain() == guid)
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid, const uint32 type) const
|
||||
{
|
||||
for (ArenaTeamContainer::const_iterator itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second->GetCaptain() == guid && itr->second->GetType() == type)
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user