mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Creatures: disabled "automatic" monster sparring
- Faction template flags weren't correct. Closes #19245
This commit is contained in:
@@ -56,24 +56,17 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
if (!me->IsWithinMeleeRange(victim))
|
||||
return;
|
||||
|
||||
bool sparAttack = me->GetFactionTemplateEntry()->ShouldSparAttack() && victim->GetFactionTemplateEntry()->ShouldSparAttack();
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
if (me->isAttackReady())
|
||||
{
|
||||
if (sparAttack)
|
||||
me->FakeAttackerStateUpdate(victim);
|
||||
else
|
||||
me->AttackerStateUpdate(victim);
|
||||
me->AttackerStateUpdate(victim);
|
||||
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
|
||||
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
|
||||
{
|
||||
if (sparAttack)
|
||||
me->FakeAttackerStateUpdate(victim, OFF_ATTACK);
|
||||
else
|
||||
me->AttackerStateUpdate(victim, OFF_ATTACK);
|
||||
me->AttackerStateUpdate(victim, OFF_ATTACK);
|
||||
|
||||
me->resetAttackTimer(OFF_ATTACK);
|
||||
}
|
||||
|
||||
@@ -314,7 +314,6 @@ enum SpawnMask
|
||||
|
||||
enum FactionTemplateFlags
|
||||
{
|
||||
FACTION_TEMPLATE_ENEMY_SPAR = 0x00000020, // guessed, sparring with enemies?
|
||||
FACTION_TEMPLATE_FLAG_PVP = 0x00000800, // flagged for PvP
|
||||
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
|
||||
FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT= 0x00002000
|
||||
|
||||
@@ -684,7 +684,6 @@ struct FactionTemplateEntry
|
||||
return hostileMask == 0 && friendlyMask == 0;
|
||||
}
|
||||
bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
|
||||
bool ShouldSparAttack() const { return (factionFlags & FACTION_TEMPLATE_ENEMY_SPAR) != 0; }
|
||||
};
|
||||
|
||||
struct GameObjectDisplayInfoEntry
|
||||
|
||||
Reference in New Issue
Block a user