фиксы обновления

This commit is contained in:
2026-08-02 20:25:03 +04:00
parent aa95d99b18
commit 4b88e1f171
11 changed files with 37 additions and 33 deletions
+2 -2
View File
@@ -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)
{
@@ -87,7 +87,7 @@ public:
sIndividualProgression->CheckAdjustments(player);
}
void OnPlayerResurrect(Player* player, float /*restore_percent*/, bool /*applySickness*/) override
void OnPlayerResurrect(Player* player, float /*restore_percent*/, bool& /*applySickness*/) override
{
sIndividualProgression->CheckAdjustments(player);
}
@@ -408,6 +408,7 @@ public:
events.Repeat(15s);
break;
case EVENT_TELEPORT:
{
me->AttackStop();
if (IN_LIVE_SIDE(me))
{
@@ -417,7 +418,10 @@ public:
{
me->CastSpell(me, SPELL_TELEPORT_LIVE, false);
}
me->GetThreatMgr().resetAggro(NotOnSameSide(me));
NotOnSameSide notOnSameSide(me);
for (ThreatReference* ref : me->GetThreatMgr().GetModifiableThreatList())
if (notOnSameSide(ref->GetVictim()))
me->GetThreatMgr().ResetThreat(ref->GetVictim());
if (Unit* pTarget = SelectTarget(SelectTargetMethod::MaxDistance, 0))
{
me->GetThreatMgr().AddThreat(pTarget, 100.0f);
@@ -425,6 +429,7 @@ public:
}
events.Repeat(20s);
break;
}
case EVENT_CHECK_HEALTH:
if (me->HealthBelowPct(30))
{
@@ -403,14 +403,13 @@ public:
case EVENT_DETONATE_MANA:
{
std::vector<Unit*> unitList;
ThreatContainer::StorageType const& threatList = me->GetThreatMgr().GetThreatList();
for (auto itr : threatList)
for (ThreatReference const* ref : me->GetThreatMgr().GetSortedThreatList())
{
if (itr->getTarget()->IsPlayer()
&& itr->getTarget()->getPowerType() == POWER_MANA
&& itr->getTarget()->GetPower(POWER_MANA))
if (ref->GetVictim()->IsPlayer()
&& ref->GetVictim()->getPowerType() == POWER_MANA
&& ref->GetVictim()->GetPower(POWER_MANA))
{
unitList.push_back(itr->getTarget());
unitList.push_back(ref->GetVictim());
}
}
if (!unitList.empty())
@@ -118,11 +118,10 @@ public:
std::list<Unit*> meleeRangeTargets;
Unit* finalTarget = nullptr;
uint8 counter = 0;
auto i = me->GetThreatMgr().GetThreatList().begin();
for (; i != me->GetThreatMgr().GetThreatList().end(); ++i, ++counter)
for (ThreatReference const* ref : me->GetThreatMgr().GetSortedThreatList())
{
// Gather all units with melee range
Unit* target = (*i)->getTarget();
Unit* target = ref->GetVictim();
if (me->IsWithinMeleeRange(target))
{
meleeRangeTargets.push_back(target);
@@ -132,6 +131,7 @@ public:
{
me->AddThreat(target, 500.0f);
}
++counter;
}
counter = 0;
std::list<Unit*, std::allocator<Unit*>>::iterator itr;
@@ -346,17 +346,16 @@ public:
}
std::vector<Unit*> targets;
auto i = me->GetThreatMgr().GetThreatList().begin();
for (; i != me->GetThreatMgr().GetThreatList().end(); ++i)
for (ThreatReference const* ref : me->GetThreatMgr().GetSortedThreatList())
{
if ((*i)->getTarget()->IsPlayer())
if (ref->GetVictim()->IsPlayer())
{
bool inList = false;
if (!blockList.empty())
{
for (GuidList::const_iterator itr = blockList.begin(); itr != blockList.end(); ++itr)
{
if ((*i)->getTarget()->GetGUID() == *itr)
if (ref->GetVictim()->GetGUID() == *itr)
{
inList = true;
break;
@@ -365,7 +364,7 @@ public:
}
if (!inList)
{
targets.push_back((*i)->getTarget());
targets.push_back(ref->GetVictim());
}
}
}
@@ -4,7 +4,7 @@
#include "ActionContext.h"
#include "IndividualProgressionOnyxiaActions.h"
#include "RaidOnyxiaActionContext.h"
#include "OnyActionContext.h"
class IPOnyxiaActionContext : public RaidOnyxiaActionContext
{
@@ -1,7 +1,7 @@
#ifdef MOD_PLAYERBOTS
#ifndef MOD_INDIVIDUAL_PROGRESSION_ONYXIAACTIONS_H
#define MOD_INDIVIDUAL_PROGRESSION_ONYXIAACTIONS_H
#include "RaidOnyxiaActions.h"
#include "OnyActions.h"
class IPOnyxiaKillWhelpsAction : public RaidOnyxiaKillWhelpsAction
{
@@ -27,6 +27,7 @@
#include "Player.h"
#include "PoolMgr.h"
#include "QuestPackets.h"
#include "RaceMgr.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
@@ -1137,7 +1138,9 @@ bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg) const
// while still respecting truly race-specific quests on the opposite side.
if (GetTeamId() != GetTeamId(true))
{
uint32 currentFactionRaceMask = (GetTeamId() == TEAM_ALLIANCE) ? RACEMASK_ALLIANCE : RACEMASK_HORDE;
uint32 currentFactionRaceMask = (GetTeamId() == TEAM_ALLIANCE)
? sRaceMgr->GetAllianceRaceMask()
: sRaceMgr->GetHordeRaceMask();
if ((reqraces & currentFactionRaceMask) == reqraces)
return true;
}