mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
fix(Core/SAI): Exclude GMs for player target/event (#22345)
This commit is contained in:
@@ -3707,10 +3707,12 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
|
||||
if (!units.empty() && baseObject)
|
||||
for (WorldObject* unit : units)
|
||||
if (IsPlayer(unit) && baseObject->IsInRange(unit, float(e.target.playerRange.minDist), float(e.target.playerRange.maxDist)))
|
||||
if (IsPlayer(unit) && !unit->ToPlayer()->IsGameMaster() && baseObject->IsInRange(unit, float(e.target.playerRange.minDist), float(e.target.playerRange.maxDist)))
|
||||
targets.push_back(unit);
|
||||
|
||||
if (e.target.playerRange.maxCount)
|
||||
Acore::Containers::RandomResize(targets, e.target.playerRange.maxCount);
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_PLAYER_DISTANCE:
|
||||
@@ -4664,10 +4666,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
if (!targets.empty())
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (IsPlayer(target))
|
||||
if (IsPlayer(target) && !target->ToPlayer()->IsGameMaster())
|
||||
playerCount++;
|
||||
}
|
||||
|
||||
if (playerCount >= e.event.nearPlayer.minCount)
|
||||
ProcessAction(e, unit);
|
||||
}
|
||||
@@ -4683,10 +4684,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
if (!targets.empty())
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (IsPlayer(target))
|
||||
if (IsPlayer(target) && !target->ToPlayer()->IsGameMaster())
|
||||
playerCount++;
|
||||
}
|
||||
|
||||
if (playerCount < e.event.nearPlayerNegation.maxCount)
|
||||
ProcessAction(e, unit);
|
||||
|
||||
Reference in New Issue
Block a user