фиксы обновления
This commit is contained in:
@@ -635,7 +635,7 @@ public:
|
||||
PLAYERHOOK_CAN_RESURRECT
|
||||
}) { }
|
||||
|
||||
void OnPlayerResurrect(Player* player, float /*restore_percent*/, bool /*applySickness*/) override
|
||||
void OnPlayerResurrect(Player* player, float /*restore_percent*/, bool& /*applySickness*/) override
|
||||
{
|
||||
sEluna->OnResurrect(player);
|
||||
}
|
||||
@@ -959,7 +959,7 @@ public:
|
||||
SERVERHOOK_CAN_PACKET_RECEIVE
|
||||
}) { }
|
||||
|
||||
bool CanPacketSend(WorldSession* session, WorldPacket& packet) override
|
||||
bool CanPacketSend(WorldSession* session, WorldPacket const& packet) override
|
||||
{
|
||||
if (!sEluna->OnPacketSend(session, packet))
|
||||
return false;
|
||||
|
||||
@@ -649,18 +649,18 @@ namespace LuaCreature
|
||||
float dist = Eluna::CHECKVAL<float>(L, 5, 0.0f);
|
||||
int32 aura = Eluna::CHECKVAL<int32>(L, 6, 0);
|
||||
|
||||
auto const& threatlist = creature->GetThreatMgr().GetThreatList();
|
||||
ThreatManager const& threatMgr = creature->GetThreatMgr();
|
||||
|
||||
if (threatlist.empty())
|
||||
if (threatMgr.IsThreatListEmpty())
|
||||
return 1;
|
||||
if (position >= threatlist.size())
|
||||
if (position >= threatMgr.GetThreatListSize())
|
||||
return 1;
|
||||
|
||||
std::list<Unit*> targetList;
|
||||
|
||||
for (auto itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
for (ThreatReference const* ref : threatMgr.GetSortedThreatList())
|
||||
{
|
||||
Unit* target = (*itr)->getTarget();
|
||||
Unit* target = ref->GetVictim();
|
||||
|
||||
if (!target)
|
||||
continue;
|
||||
@@ -730,14 +730,14 @@ namespace LuaCreature
|
||||
*/
|
||||
int GetAITargets(lua_State* L, Creature* creature)
|
||||
{
|
||||
auto const& threatlist = creature->GetThreatMgr().GetThreatList();
|
||||
ThreatManager const& threatMgr = creature->GetThreatMgr();
|
||||
|
||||
lua_createtable(L, threatlist.size(), 0);
|
||||
lua_createtable(L, threatMgr.GetThreatListSize(), 0);
|
||||
int tbl = lua_gettop(L);
|
||||
uint32 i = 0;
|
||||
for (auto itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
for (ThreatReference const* ref : threatMgr.GetSortedThreatList())
|
||||
{
|
||||
Unit* target = (*itr)->getTarget();
|
||||
Unit* target = ref->GetVictim();
|
||||
|
||||
if (!target)
|
||||
continue;
|
||||
|
||||
@@ -1902,12 +1902,10 @@ namespace LuaUnit
|
||||
return 1;
|
||||
}
|
||||
|
||||
ThreatContainer::StorageType const& list = unit->GetThreatMgr().GetThreatList();
|
||||
|
||||
lua_newtable(L);
|
||||
int table = lua_gettop(L);
|
||||
uint32 i = 1;
|
||||
for (ThreatReference* item : list)
|
||||
for (ThreatReference const* item : unit->GetThreatMgr().GetSortedThreatList())
|
||||
{
|
||||
if (!item)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user