aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-07-30 10:36:38 +0300
committerShauren <shauren.trinity@gmail.com>2022-03-11 21:20:04 +0100
commit53d19b09f4de7c092747663ae7e1a01c0df553bf (patch)
tree41efcfbadf26ec69e5ee4077b3514134a9176442
parent5afa32e9a7e944d5fbee620c31bf6e2939ec7c5d (diff)
Core/Creature: rename CREATURE_FLAG_EXTRA_IGNORE_COMBAT into CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT (#26762)
Co-authored-by: offl <offl@users.noreply.github.com> (cherry picked from commit 06b554c36e8f196667e0a72820b37b9dc25bdde0)
-rw-r--r--src/server/game/Combat/CombatManager.cpp4
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp2
-rw-r--r--src/server/game/Entities/Creature/CreatureData.h2
-rw-r--r--src/server/game/Entities/Creature/enuminfo_CreatureData.cpp6
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.h10
6 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/Combat/CombatManager.cpp b/src/server/game/Combat/CombatManager.cpp
index d0401ded76c..dbe9f33f6b4 100644
--- a/src/server/game/Combat/CombatManager.cpp
+++ b/src/server/game/Combat/CombatManager.cpp
@@ -43,8 +43,8 @@
return false;
if (a->HasUnitState(UNIT_STATE_IN_FLIGHT) || b->HasUnitState(UNIT_STATE_IN_FLIGHT))
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/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 62b77a930c2..9f74a9a1d24 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -685,7 +685,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
- SetIgnoringCombat((cInfo->flags_extra & CREATURE_FLAG_EXTRA_IGNORE_COMBAT) != 0);
+ SetIsCombatDisallowed((cInfo->flags_extra & CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT) != 0);
LoadTemplateRoot();
InitializeMovementFlags();
diff --git a/src/server/game/Entities/Creature/CreatureData.h b/src/server/game/Entities/Creature/CreatureData.h
index 327ab174eda..11aaf1d7abb 100644
--- a/src/server/game/Entities/Creature/CreatureData.h
+++ b/src/server/game/Entities/Creature/CreatureData.h
@@ -271,7 +271,7 @@ enum CreatureFlagsExtra : uint32
CREATURE_FLAG_EXTRA_GHOST_VISIBILITY = 0x00000400, // creature will only be visible to dead players
CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK = 0x00000800, // creature will use offhand attacks
CREATURE_FLAG_EXTRA_NO_SELL_VENDOR = 0x00001000, // players can't sell items to this vendor
- CREATURE_FLAG_EXTRA_IGNORE_COMBAT = 0x00002000, // creature is not allowed to enter combat
+ CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT = 0x00002000, // creature is not allowed to enter combat
CREATURE_FLAG_EXTRA_WORLDEVENT = 0x00004000, // custom flag for world event creatures (left room for merging)
CREATURE_FLAG_EXTRA_GUARD = 0x00008000, // Creature is guard
CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH = 0x00010000, // creature ignores feign death
diff --git a/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp b/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
index 3b5bbbd67c6..13fcc0cb512 100644
--- a/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
+++ b/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
@@ -44,7 +44,7 @@ TC_API_EXPORT EnumText EnumUtils<CreatureFlagsExtra>::ToString(CreatureFlagsExtr
case CREATURE_FLAG_EXTRA_GHOST_VISIBILITY: return { "CREATURE_FLAG_EXTRA_GHOST_VISIBILITY", "CREATURE_FLAG_EXTRA_GHOST_VISIBILITY", "creature will only be visible to dead players" };
case CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK: return { "CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK", "CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK", "creature will use offhand attacks" };
case CREATURE_FLAG_EXTRA_NO_SELL_VENDOR: return { "CREATURE_FLAG_EXTRA_NO_SELL_VENDOR", "CREATURE_FLAG_EXTRA_NO_SELL_VENDOR", "players can't sell items to this vendor" };
- case CREATURE_FLAG_EXTRA_IGNORE_COMBAT: return { "CREATURE_FLAG_EXTRA_IGNORE_COMBAT", "CREATURE_FLAG_EXTRA_IGNORE_COMBAT", "creature is not allowed to enter combat" };
+ case CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT: return { "CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT", "CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT", "creature is not allowed to enter combat" };
case CREATURE_FLAG_EXTRA_WORLDEVENT: return { "CREATURE_FLAG_EXTRA_WORLDEVENT", "CREATURE_FLAG_EXTRA_WORLDEVENT", "custom flag for world event creatures (left room for merging)" };
case CREATURE_FLAG_EXTRA_GUARD: return { "CREATURE_FLAG_EXTRA_GUARD", "CREATURE_FLAG_EXTRA_GUARD", "Creature is guard" };
case CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH: return { "CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH", "CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH", "creature ignores feign death" };
@@ -88,7 +88,7 @@ TC_API_EXPORT CreatureFlagsExtra EnumUtils<CreatureFlagsExtra>::FromIndex(size_t
case 10: return CREATURE_FLAG_EXTRA_GHOST_VISIBILITY;
case 11: return CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK;
case 12: return CREATURE_FLAG_EXTRA_NO_SELL_VENDOR;
- case 13: return CREATURE_FLAG_EXTRA_IGNORE_COMBAT;
+ case 13: return CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT;
case 14: return CREATURE_FLAG_EXTRA_WORLDEVENT;
case 15: return CREATURE_FLAG_EXTRA_GUARD;
case 16: return CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH;
@@ -129,7 +129,7 @@ TC_API_EXPORT size_t EnumUtils<CreatureFlagsExtra>::ToIndex(CreatureFlagsExtra v
case CREATURE_FLAG_EXTRA_GHOST_VISIBILITY: return 10;
case CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK: return 11;
case CREATURE_FLAG_EXTRA_NO_SELL_VENDOR: return 12;
- case CREATURE_FLAG_EXTRA_IGNORE_COMBAT: return 13;
+ case CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT: return 13;
case CREATURE_FLAG_EXTRA_WORLDEVENT: return 14;
case CREATURE_FLAG_EXTRA_GUARD: return 15;
case CREATURE_FLAG_EXTRA_IGNORE_FEIGN_DEATH: return 16;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index a9adf79db7d..de3012895cd 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -397,7 +397,7 @@ Unit::Unit(bool isWorldObject) :
_oldFactionId = 0;
_isWalkingBeforeCharm = false;
_instantCast = false;
- _isIgnoringCombat = false;
+ _isCombatDisallowed = false;
}
////////////////////////////////////////////////////////////
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 4e5b7cf42f1..bb4a995240f 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1861,10 +1861,10 @@ class TC_GAME_API Unit : public WorldObject
uint16 GetVirtualItemAppearanceMod(uint32 slot) const;
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId = 0, uint16 itemVisual = 0);
- // returns if the unit is ignoring any combat interaction
- bool IsIgnoringCombat() const { return _isIgnoringCombat; }
- // enables/disables combat interaction of this unit.
- void SetIgnoringCombat(bool apply) { _isIgnoringCombat = apply; }
+ // returns if the unit can't enter combat
+ bool IsCombatDisallowed() const { return _isCombatDisallowed; }
+ // enables / disables combat interaction of this unit
+ void SetIsCombatDisallowed(bool apply) { _isCombatDisallowed = apply; }
std::string GetDebugInfo() const override;
@@ -2046,7 +2046,7 @@ class TC_GAME_API Unit : public WorldObject
std::unique_ptr<MovementForces> _movementForces;
PositionUpdateInfo _positionUpdateInfo;
- bool _isIgnoringCombat;
+ bool _isCombatDisallowed;
};
namespace Trinity