*Fix a bug in ScriptedAI::SelectUnitList.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-04 15:27:11 -06:00
parent d608a48839
commit 2641173fbe
2 changed files with 2 additions and 2 deletions
+2 -1
View File
@@ -432,7 +432,7 @@ void ScriptedAI::SelectUnitList(std::list<Unit*> &targetList, uint32 num, Select
std::list<HostilReference*> m_threatlist = m_creature->getThreatManager().getThreatList();
std::list<HostilReference*>::iterator i;
Unit *target;
while(m_threatlist.size())
while(m_threatlist.size() && num)
{
if(targetType == SELECT_TARGET_BOTTOMAGGRO)
{
@@ -455,6 +455,7 @@ void ScriptedAI::SelectUnitList(std::list<Unit*> &targetList, uint32 num, Select
continue;
}
targetList.push_back(target);
--num;
}
}
}