From 4de86618f31036fa37404cea7008c98c24ce5553 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 29 May 2022 16:18:29 -0400 Subject: [PATCH] Core/Creature: rename CREATURE_FLAG_EXTRA_IGNORE_COMBAT into CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT Port From (https://github.com/TrinityCore/TrinityCore/commit/53d19b09f4de7c092747663ae7e1a01c0df553bf) --- Source/Framework/Constants/CreatureConst.cs | 2 +- Source/Game/Combat/CombatManager.cs | 4 ++-- Source/Game/Entities/Creature/Creature.cs | 2 +- Source/Game/Entities/Unit/Unit.Combat.cs | 8 ++++---- Source/Game/Entities/Unit/Unit.Fields.cs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Framework/Constants/CreatureConst.cs b/Source/Framework/Constants/CreatureConst.cs index ed7fef81a..fc435ab0c 100644 --- a/Source/Framework/Constants/CreatureConst.cs +++ b/Source/Framework/Constants/CreatureConst.cs @@ -226,7 +226,7 @@ namespace Framework.Constants GhostVisibility = 0x400, // creature will only be visible to dead players UseOffhandAttack = 0x800, // creature will use offhand attacks NoSellVendor = 0x1000, // players can't sell items to this vendor - IgnoreCombat = 0x2000, // creature is not allowed to enter combat + CannotEnterCombat = 0x2000, // creature is not allowed to enter combat Worldevent = 0x4000, // Custom Flag For World Event Creatures (Left Room For Merging) Guard = 0x8000, // Creature Is Guard IgnoreFeighDeath = 0x10000, // creature ignores feign death diff --git a/Source/Game/Combat/CombatManager.cs b/Source/Game/Combat/CombatManager.cs index 542f48f95..97e8a302f 100644 --- a/Source/Game/Combat/CombatManager.cs +++ b/Source/Game/Combat/CombatManager.cs @@ -57,8 +57,8 @@ namespace Game.Combat return false; if (a.HasUnitState(UnitState.InFlight) || b.HasUnitState(UnitState.InFlight)) return false; - // ... both units must not be ignoring combat - if (a.IsIgnoringCombat() || b.IsIgnoringCombat()) + // ... both units must be allowed to enter combat + if (a.IsCombatDisallowed() || b.IsCombatDisallowed()) return false; if (a.IsFriendlyTo(b) || b.IsFriendlyTo(a)) return false; diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index d3be11e79..1f2de9615 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -424,7 +424,7 @@ namespace Game.Entities ApplySpellImmune(0, SpellImmunity.Effect, SpellEffectName.AttackMe, true); } - SetIgnoringCombat(cInfo.FlagsExtra.HasFlag(CreatureFlagsExtra.IgnoreCombat)); + SetIsCombatDisallowed(cInfo.FlagsExtra.HasFlag(CreatureFlagsExtra.CannotEnterCombat)); LoadTemplateRoot(); InitializeMovementFlags(); diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index ce160f24c..9ea13c114 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -1530,13 +1530,13 @@ namespace Game.Entities } /// - /// returns if the unit is ignoring any combat interaction + /// returns if the unit can't enter combat /// - public bool IsIgnoringCombat() { return _isIgnoringCombat; } + public bool IsCombatDisallowed() { return _isCombatDisallowed; } /// - /// enables/disables combat interaction of this unit. + /// enables / disables combat interaction of this unit /// - public void SetIgnoringCombat(bool apply) { _isIgnoringCombat = apply; } + public void SetIsCombatDisallowed(bool apply) { _isCombatDisallowed = apply; } } } diff --git a/Source/Game/Entities/Unit/Unit.Fields.cs b/Source/Game/Entities/Unit/Unit.Fields.cs index dfd21865c..f7a3b34d4 100644 --- a/Source/Game/Entities/Unit/Unit.Fields.cs +++ b/Source/Game/Entities/Unit/Unit.Fields.cs @@ -55,7 +55,7 @@ namespace Game.Entities uint[] m_baseAttackSpeed = new uint[(int)WeaponAttackType.Max]; internal float[] m_modAttackSpeedPct = new float[(int)WeaponAttackType.Max]; protected uint[] m_attackTimer = new uint[(int)WeaponAttackType.Max]; - bool _isIgnoringCombat; + bool _isCombatDisallowed; // Threat+combat management CombatManager m_combatManager;