mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Dungeon code cleanup
Consistent code, easier to read logic flow and some missing nullptr checks
This commit is contained in:
@@ -12,12 +12,12 @@ bool ShatterSpreadAction::Execute(Event event)
|
||||
GuidVector members = AI_VALUE(GuidVector, "group members");
|
||||
for (auto& member : members)
|
||||
{
|
||||
if (bot->GetGUID() == member)
|
||||
Unit* unit = botAI->GetUnit(member);
|
||||
if (!unit || bot->GetGUID() == member)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!closestMember ||
|
||||
bot->GetExactDist2d(botAI->GetUnit(member)) < bot->GetExactDist2d(closestMember))
|
||||
if (!closestMember || bot->GetExactDist2d(unit) < bot->GetExactDist2d(closestMember))
|
||||
{
|
||||
closestMember = botAI->GetUnit(member);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user