Core/Misc: Some cleanups

This commit is contained in:
hondacrx
2018-03-05 12:13:45 -05:00
parent 3fc07b8b37
commit 7de76148b6
9 changed files with 58 additions and 122 deletions
@@ -760,14 +760,14 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.KrikthirTheGatewatcher
void HandleTargets(List<WorldObject> targetList)
{
// Remove any Watchers that are already in combat
foreach (var obj in targetList.ToList())
for (var i = 0; i < targetList.Count; ++i)
{
Creature creature = obj.ToCreature();
Creature creature = targetList[i].ToCreature();
if (creature)
if (creature.IsAlive() && !creature.IsInCombat())
continue;
targetList.Remove(obj);
targetList.RemoveAt(i);
}
// Default to Krik'thir himself if he isn't engaged
@@ -573,7 +573,7 @@ namespace Scripts.Northrend.IcecrownCitadel
return;
List<Creature> temp = new List<Creature>();
foreach (var guid in summons.ToList())
foreach (var guid in summons)
{
Creature cre = ObjectAccessor.GetCreature(me, guid);
if (cre)