Core/Misc: fixed build

This commit is contained in:
Ovahlord committed 2020-07-22 18:35:41 +02:00
1 parent 47ef91c23d
commit de6a514ec5
11 files changed
+28 -28

No files matched your search

+1 -1
View File
@@ -342,7 +342,7 @@ bool CombatManager::UpdateOwnerCombatState() const
{
_owner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
_owner->AtExitCombat();
if (_owner->IsEngaged() && !(_owner->ToCreature() && _owner->ToCreature()->IsAIEnabled()))
if (_owner->IsEngaged() && !(_owner->ToCreature() && _owner->ToCreature()->IsAIEnabled))
_owner->AtDisengage();
}
-1
View File
@@ -103,7 +103,6 @@ class TC_GAME_API CombatManager
~CombatManager();
void Update(uint32 tdiff); // called from Unit::Update
Unit* GetOwner() const { return _owner; }
Unit* GetOwner() const { return _owner; }
bool HasCombat() const { return HasPvECombat() || HasPvPCombat(); }
bool HasPvECombat() const { return !_pveRefs.empty(); }
-13
View File
@@ -292,13 +292,6 @@ void ThreatManager::EvaluateSuppressed(bool canExpire)
}
}
static void SaveCreatureHomePositionIfNeed(Creature* c)
{
MovementGeneratorType const movetype = c->GetMotionMaster()->GetCurrentMovementGeneratorType();
if (movetype == WAYPOINT_MOTION_TYPE || movetype == POINT_MOTION_TYPE || (c->IsAIEnabled && c->AI()->IsEscorted()))
c->SetHomePosition(c->GetPosition());
}
void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell, bool ignoreModifiers, bool ignoreRedirects)
{
// step 1: we can shortcut if the spell has one of the NO_THREAT attrs set - nothing will happen
@@ -402,12 +395,6 @@ void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell
{
_owner->AtEngage(target);
UpdateVictim();
SaveCreatureHomePositionIfNeed(cOwner);
if (cOwner->IsAIEnabled)
cOwner->AI()->JustEngagedWith(target);
if (CreatureGroup* formation = cOwner->GetFormation())
formation->MemberEngagingTarget(cOwner, target);
}
}
+4 -4
View File
@@ -1232,10 +1232,10 @@ class TC_GAME_API Unit : public WorldObject
/// ====================== THREAT & COMBAT ====================
bool CanHaveThreatList() const { return m_threatManager.CanHaveThreatList(); }
// For NPCs with threat list: Whether there are any enemies on our threat list
// For other units: Whether we're in combat
// This value is different from IsInCombat when a projectile spell is midair (combat on launch - threat+aggro on impact)
bool IsEngaged() const { return CanHaveThreatList() ? m_threatManager.IsEngaged() : IsInCombat(); }
// This value can be different from IsInCombat:
// - when a projectile spell is midair against a creature (combat on launch - threat+aggro on impact)
// - when the creature has no targets left, but the AI has not yet ceased engaged logic
bool IsEngaged() const { return m_isEngaged; }
bool IsEngagedBy(Unit const* who) const { return CanHaveThreatList() ? IsThreatenedBy(who) : IsInCombatWith(who); }
void EngageWithTarget(Unit* who); // Adds target to threat list if applicable, otherwise just sets combat state
// Combat handling
+2 -2
View File
@@ -2700,8 +2700,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
// spellHitTarget can be null if spell is missed in DoSpellHitOnUnit
if (missInfo != SPELL_MISS_EVADE && spellHitTarget && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL)))
{
if (Unit* unitCaster = spell->m_caster->ToUnit())
unitCaster->AtTargetAttacked(unit, spell->m_spellInfo->HasInitialAggro());
if (Unit* unitCaster = m_caster->ToUnit())
unitCaster->AtTargetAttacked(unit, m_spellInfo->HasInitialAggro());
if (!unit->IsStandState())
unit->SetStandState(UNIT_STAND_STATE_STAND);
+1 -1
View File
@@ -997,7 +997,7 @@ public:
for (auto const& outerPair : redirectRegistry) // (spellId, (guid, pct))
{
SpellInfo const* const spell = sSpellMgr->GetSpellInfo(outerPair.first);
handler->PSendSysMessage(" |-- #%06u %s (%zu entries):", outerPair.first, spell ? spell->SpellName[0] : "<unknown>", outerPair.second.size());
handler->PSendSysMessage(" |-- #%06u %s (%zu entries):", outerPair.first, spell ? spell->SpellName : "<unknown>", outerPair.second.size());
for (auto const& innerPair : outerPair.second) // (guid, pct)
{
Unit* unit = ObjectAccessor::GetUnit(*target, innerPair.first);
+8 -2
View File
@@ -207,8 +207,14 @@ public:
}
//Teleport group to given game_tele.entry
static bool HandleTeleGroupCommand(ChatHandler* handler, GameTele const* tele)
static bool HandleTeleGroupCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
GameTele const* tele = handler->extractGameTeleFromLink((char*)args);
if (!tele)
{
handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
@@ -285,7 +291,7 @@ public:
return true;
}
static bool HandleTeleCommand(ChatHandler* handler, GameTele const* tele)
static bool HandleTeleCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
@@ -182,7 +182,7 @@ class npc_harbinger_of_flame : public CreatureScript
void JustEngagedWith(Unit* /*target*/) override
{
if (Creature* bird = ObjectAccessor::GetCreature(*me, me->GetChannelObjectGuid()))
DoZoneInCombat(bird, 200.0f);
DoZoneInCombat(bird);
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
_events.Reset();
@@ -30,7 +30,7 @@ class DelayedAttackStartEvent : public BasicEvent
bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override
{
_owner->AI()->DoZoneInCombat(_owner, 200.0f);
_owner->AI()->DoZoneInCombat(_owner);
return true;
}
@@ -608,7 +608,7 @@ class boss_razorscale : public CreatureScript
case ACTION_EVENT_START:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
DoZoneInCombat(me, 150.0f);
DoZoneInCombat(me);
break;
}
}
+9 -1
View File
@@ -1713,7 +1713,15 @@ class npc_brewfest_reveler : public CreatureScript
enum TrainingDummy
{
NPC_ADVANCED_TARGET_DUMMY = 2674,
NPC_TARGET_DUMMY = 2673
NPC_TARGET_DUMMY = 2673,
NPC_SPELL_PRACTICE_CREDIT = 44175,
SPELL_CHARGE = 100,
SPELL_JUDGEMENT = 29271,
SPELL_STEADY_SHOT = 56641,
SPELL_EVISCERATE = 2098,
SPELL_PRIMAL_STRIKE = 73899,
SPELL_IMMOLATE = 348,
SPELL_ARCANE_MISSILES = 5143,
};
class npc_training_dummy : public CreatureScript