mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-09 13:51:10 +00:00
feat(Core/Map): add DoForAllPlayers method (#10371)
This commit is contained in:
@@ -3757,6 +3757,17 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 lightId, Milliseconds fadeI
|
||||
}
|
||||
}
|
||||
|
||||
void Map::DoForAllPlayers(std::function<void(Player*)> exec)
|
||||
{
|
||||
for (auto const& it : GetPlayers())
|
||||
{
|
||||
if (Player* player = it.GetSource())
|
||||
{
|
||||
exec(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if a given source can reach a specific point following a path
|
||||
* and normalize the coords. Use this method for long paths, otherwise use the
|
||||
|
||||
Reference in New Issue
Block a user