mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)
This commit is contained in:
@@ -488,7 +488,7 @@ void Battlefield::HideNpc(Creature* creature)
|
||||
{
|
||||
creature->CombatStop();
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->SetPhaseMask(2, false); // pussywizard: false because UpdateObjectVisibility(true) is called below in SetVisible(), no need to have it here
|
||||
creature->DisappearAndDie();
|
||||
creature->SetVisible(false);
|
||||
@@ -498,14 +498,14 @@ void Battlefield::ShowNpc(Creature* creature, bool aggressive)
|
||||
{
|
||||
creature->SetPhaseMask(1, false); // pussywizard: false because UpdateObjectVisibility(true) is called below in SetVisible(), no need to have it here
|
||||
creature->SetVisible(true);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (!creature->IsAlive())
|
||||
creature->Respawn(true);
|
||||
if (aggressive)
|
||||
creature->SetReactState(REACT_AGGRESSIVE);
|
||||
else
|
||||
{
|
||||
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user