Core/Unit: UNIT_FLAG renames

Port From (https://github.com/TrinityCore/TrinityCore/commit/f1ac141f25500a0f6ffd3c32b1185de2d9f9c940)
This commit is contained in:
hondacrx
2021-09-26 14:00:30 -04:00
parent 2595e859a2
commit 9afc755dec
15 changed files with 50 additions and 50 deletions
+2 -2
View File
@@ -517,7 +517,7 @@ namespace Game.Entities
if (attType != WeaponAttackType.BaseAttack && attType != WeaponAttackType.OffAttack)
return;
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.PlayerControlled) && !HasUnitFlag2(UnitFlags2.DisableTurn))
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.Possessed) && !HasUnitFlag2(UnitFlags2.DisableTurn))
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
// melee attack spell casted at main hand attack only - no normal melee dmg dealt
@@ -600,7 +600,7 @@ namespace Game.Entities
if (attType != WeaponAttackType.BaseAttack && attType != WeaponAttackType.OffAttack)
return; // ignore ranged case
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.PlayerControlled) && !HasUnitFlag2(UnitFlags2.DisableTurn))
if (IsTypeId(TypeId.Unit) && !HasUnitFlag(UnitFlags.Possessed) && !HasUnitFlag2(UnitFlags2.DisableTurn))
SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells)
CalcDamageInfo damageInfo = new();
+1 -1
View File
@@ -54,7 +54,7 @@ namespace Game.Entities
// Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water
if (HasUnitFlag(UnitFlags.CannotSwim))
return false;
if (HasUnitFlag(UnitFlags.PvpAttackable)) // is player
if (HasUnitFlag(UnitFlags.PlayerControlled)) // is player
return true;
if (HasUnitFlag2((UnitFlags2)0x1000000))
return false;
+10 -10
View File
@@ -147,7 +147,7 @@ namespace Game.Entities
if (IsTypeId(TypeId.Player))
{
minion.m_ControlledByPlayer = true;
minion.AddUnitFlag(UnitFlags.PvpAttackable);
minion.AddUnitFlag(UnitFlags.PlayerControlled);
}
// Can only have one pet. If a new one is summoned, dismiss the old one.
@@ -406,12 +406,12 @@ namespace Game.Entities
switch (type)
{
case CharmType.Vehicle:
AddUnitFlag(UnitFlags.PlayerControlled);
AddUnitFlag(UnitFlags.Possessed);
playerCharmer.SetClientControl(this, true);
playerCharmer.VehicleSpellInitialize();
break;
case CharmType.Possess:
AddUnitFlag(UnitFlags.PlayerControlled);
AddUnitFlag(UnitFlags.Possessed);
charmer.AddUnitFlag(UnitFlags.RemoveClientControl);
playerCharmer.SetClientControl(this, true);
playerCharmer.PossessSpellInitialize();
@@ -507,14 +507,14 @@ namespace Game.Entities
case CharmType.Vehicle:
playerCharmer.SetClientControl(this, false);
playerCharmer.SetClientControl(charmer, true);
RemoveUnitFlag(UnitFlags.PlayerControlled);
RemoveUnitFlag(UnitFlags.Possessed);
break;
case CharmType.Possess:
ClearUnitState(UnitState.Possessed);
playerCharmer.SetClientControl(this, false);
playerCharmer.SetClientControl(charmer, true);
charmer.RemoveUnitFlag(UnitFlags.RemoveClientControl);
RemoveUnitFlag(UnitFlags.PlayerControlled);
RemoveUnitFlag(UnitFlags.Possessed);
break;
case CharmType.Charm:
if (IsTypeId(TypeId.Unit) && charmer.GetClass() == Class.Warlock)
@@ -594,7 +594,7 @@ namespace Game.Entities
charm.m_ControlledByPlayer = true;
// @todo maybe we can use this flag to check if controlled by player
charm.AddUnitFlag(UnitFlags.PvpAttackable);
charm.AddUnitFlag(UnitFlags.PlayerControlled);
}
else
charm.m_ControlledByPlayer = false;
@@ -635,19 +635,19 @@ namespace Game.Entities
if (charm.IsTypeId(TypeId.Player))
{
charm.m_ControlledByPlayer = true;
charm.AddUnitFlag(UnitFlags.PvpAttackable);
charm.AddUnitFlag(UnitFlags.PlayerControlled);
charm.ToPlayer().UpdatePvPState();
}
else if (player)
{
charm.m_ControlledByPlayer = true;
charm.AddUnitFlag(UnitFlags.PvpAttackable);
charm.AddUnitFlag(UnitFlags.PlayerControlled);
charm.SetPvpFlags(player.GetPvpFlags());
}
else
{
charm.m_ControlledByPlayer = false;
charm.RemoveUnitFlag(UnitFlags.PvpAttackable);
charm.RemoveUnitFlag(UnitFlags.PlayerControlled);
charm.SetPvpFlags(UnitPVPStateFlags.None);
}
@@ -791,7 +791,7 @@ namespace Game.Entities
pet.SetCreatedBySpell(spell_id);
if (IsTypeId(TypeId.Player))
pet.AddUnitFlag(UnitFlags.PvpAttackable);
pet.AddUnitFlag(UnitFlags.PlayerControlled);
if (!pet.InitStatsForLevel(level))
{
+4 -4
View File
@@ -2843,11 +2843,11 @@ namespace Game.Entities
{
List<CombatReference> toEnd = new();
foreach (var pair in m_combatManager.GetPvECombatRefs())
if (pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PvpAttackable))
if (pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PlayerControlled))
toEnd.Add(pair.Value);
foreach (var pair in m_combatManager.GetPvPCombatRefs())
if (pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PvpAttackable))
if (pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PlayerControlled))
toEnd.Add(pair.Value);
foreach (CombatReference refe in toEnd)
@@ -2877,11 +2877,11 @@ namespace Game.Entities
{
List<CombatReference> toEnd = new();
foreach (var pair in m_combatManager.GetPvECombatRefs())
if (!pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PvpAttackable))
if (!pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PlayerControlled))
toEnd.Add(pair.Value);
foreach (var pair in m_combatManager.GetPvPCombatRefs())
if (!pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PvpAttackable))
if (!pair.Value.GetOther(this).HasUnitFlag(UnitFlags.PlayerControlled))
toEnd.Add(pair.Value);
foreach (CombatReference refe in toEnd)