Core/Entities: clarify comment added in c7ea952a47
This commit is contained in:
@@ -11986,7 +11986,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
|||||||
if (IsAIEnabled)
|
if (IsAIEnabled)
|
||||||
{
|
{
|
||||||
creature->AI()->EnterCombat(enemy);
|
creature->AI()->EnterCombat(enemy);
|
||||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // always remove Out of Combat Non Attackable flag if we enter combat and AI is enabled
|
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // unit has engaged in combat, remove immunity so players can fight back
|
||||||
}
|
}
|
||||||
if (creature->GetFormation())
|
if (creature->GetFormation())
|
||||||
creature->GetFormation()->MemberAttackStart(creature, enemy);
|
creature->GetFormation()->MemberAttackStart(creature, enemy);
|
||||||
@@ -12019,7 +12019,7 @@ void Unit::ClearInCombat()
|
|||||||
if (Creature* creature = ToCreature())
|
if (Creature* creature = ToCreature())
|
||||||
{
|
{
|
||||||
if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC)
|
if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC)
|
||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // re-apply Out of Combat Non Attackable flag if we leave combat, can be overriden in scripts in EnterEvadeMode()
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade
|
||||||
|
|
||||||
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
|
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
|
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
|
||||||
|
|||||||
@@ -589,8 +589,8 @@ enum UnitFlags
|
|||||||
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
|
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP
|
||||||
UNIT_FLAG_UNK_6 = 0x00000040,
|
UNIT_FLAG_UNK_6 = 0x00000040,
|
||||||
UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
|
UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE
|
||||||
UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables actions by PlayerCharacters (PC) on unit - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
|
UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
|
||||||
UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables actions by NonPlayerCharacters (NPC) on unit - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
|
UNIT_FLAG_IMMUNE_TO_NPC = 0x00000200, // disables combat/assistance with NonPlayerCharacters (NPC) - see Unit::_IsValidAttackTarget, Unit::_IsValidAssistTarget
|
||||||
UNIT_FLAG_LOOTING = 0x00000400, // loot animation
|
UNIT_FLAG_LOOTING = 0x00000400, // loot animation
|
||||||
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
|
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
|
||||||
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
|
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
|
||||||
|
|||||||
Reference in New Issue
Block a user