mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -04:00
Core/SAI: Add maxSize parameter to SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_CREATURE_RANGE and SMART_TARGET_GAMEOBJECT_RANGE
(cherry picked from commit 46368188ce)
This commit is contained in:
@@ -2726,6 +2726,9 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
if ((!e.target.unitRange.creature || unit->ToCreature()->GetEntry() == e.target.unitRange.creature) && baseObject->IsInRange(unit, float(e.target.unitRange.minDist), float(e.target.unitRange.maxDist)))
|
||||
targets.push_back(unit);
|
||||
}
|
||||
|
||||
if (e.target.unitRange.maxSize)
|
||||
Trinity::Containers::RandomResize(targets, e.target.unitRange.maxSize);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_CREATURE_DISTANCE:
|
||||
@@ -2744,6 +2747,9 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
if (!e.target.unitDistance.creature || unit->ToCreature()->GetEntry() == e.target.unitDistance.creature)
|
||||
targets.push_back(unit);
|
||||
}
|
||||
|
||||
if (e.target.unitDistance.maxSize)
|
||||
Trinity::Containers::RandomResize(targets, e.target.unitDistance.maxSize);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_GAMEOBJECT_DISTANCE:
|
||||
@@ -2762,6 +2768,9 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
if (!e.target.goDistance.entry || unit->ToGameObject()->GetEntry() == e.target.goDistance.entry)
|
||||
targets.push_back(unit);
|
||||
}
|
||||
|
||||
if (e.target.goDistance.maxSize)
|
||||
Trinity::Containers::RandomResize(targets, e.target.goDistance.maxSize);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_GAMEOBJECT_RANGE:
|
||||
@@ -2780,6 +2789,9 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
if ((!e.target.goRange.entry && unit->ToGameObject()->GetEntry() == e.target.goRange.entry) && baseObject->IsInRange(unit, float(e.target.goRange.minDist), float(e.target.goRange.maxDist)))
|
||||
targets.push_back(unit);
|
||||
}
|
||||
|
||||
if (e.target.goRange.maxSize)
|
||||
Trinity::Containers::RandomResize(targets, e.target.goRange.maxSize);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_CREATURE_GUID:
|
||||
|
||||
Reference in New Issue
Block a user