diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-03-06 19:11:03 -0300 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2019-08-17 20:04:14 +0200 |
| commit | 27b5d1834850a1e7c64cb03200cdf7610d354730 (patch) | |
| tree | 5bd3ede9148c3266e2f1f3166f8b1b577b9c1cd4 | |
| parent | 8ae3188bff0f7cfedd326b9d24ec51cbc9b97dff (diff) | |
Core/Creatures: disabled "automatic" monster sparring
- Faction template flags weren't correct.
Closes #19245
(cherrypicked from b2fc4c65eda779f880d9fc126d8b7aaef8c2ab25)
| -rw-r--r-- | src/server/game/AI/CoreAI/UnitAI.cpp | 11 | ||||
| -rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 1 | ||||
| -rw-r--r-- | src/server/game/DataStores/DBCEnums.h | 1 |
3 files changed, 2 insertions, 11 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index a912ed21478..2dc80e7def3 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -63,24 +63,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); } diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 2abf0d78fd2..71958a94791 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -1096,7 +1096,6 @@ struct FactionTemplateEntry return EnemyGroup == 0 && FriendGroup == 0; } bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } - bool ShouldSparAttack() const { return (Flags & FACTION_TEMPLATE_ENEMY_SPAR) != 0; } }; struct GameObjectDisplayInfoEntry diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index e1ff83ea337..dd180cbdfd6 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -675,7 +675,6 @@ enum class ExpectedStatType : uint8 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 |
