@@ -657,11 +657,11 @@ namespace LuaCreature
657657 float dist = E->CHECKVAL <float >(5 , 0 .0f );
658658 int32 aura = E->CHECKVAL <int32>(6 , 0 );
659659
660- auto const & threatlist = creature->GetThreatMgr ().GetThreatList ();
660+ auto const & threatlist = creature->GetThreatMgr ().GetSortedThreatList ();
661661
662- if (threatlist. empty ())
662+ if (creature-> GetThreatMgr (). GetThreatListSize ())
663663 return 1 ;
664- if (position >= threatlist. size ())
664+ if (position >= creature-> GetThreatMgr (). GetThreatListSize ())
665665 return 1 ;
666666
667667 std::list<Unit*> targetList;
@@ -736,9 +736,9 @@ namespace LuaCreature
736736 */
737737 int GetAITargets (Eluna* E, Creature* creature)
738738 {
739- auto const & threatlist = creature->GetThreatMgr ().GetThreatList ();
739+ auto const & threatlist = creature->GetThreatMgr ().GetUnsortedThreatList ();
740740
741- lua_createtable (E->L , threatlist. size (), 0 );
741+ lua_createtable (E->L , creature-> GetThreatMgr (). GetThreatListSize (), 0 );
742742 int tbl = lua_gettop (E->L );
743743
744744 uint32 i = 0 ;
@@ -792,7 +792,7 @@ namespace LuaCreature
792792 float schoolMask = E->CHECKVAL <uint32>(4 , 0 );
793793 uint32 spell = E->CHECKVAL <uint32>(5 , 0 );
794794
795- creature->GetThreatMgr ().AddThreat (victim, threat, (SpellSchoolMask)schoolMask, spell ? sSpellMgr ->GetSpellInfo (spell) : NULL );
795+ creature->GetThreatMgr ().AddThreat (victim, threat, spell ? sSpellMgr ->GetSpellInfo (spell) : NULL );
796796 return 0 ;
797797 }
798798
0 commit comments