feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)

This commit is contained in:
Kitzunu
2022-03-30 12:59:42 +02:00
committed by GitHub
parent 54c06eb72e
commit 856aed6fc6
243 changed files with 1205 additions and 1191 deletions

View File

@@ -1764,7 +1764,7 @@ void Battleground::HandleKillPlayer(Player* victim, Player* killer)
if (!isArena())
{
// To be able to remove insignia -- ONLY IN Battlegrounds
victim->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
victim->SetUnitFlag(UNIT_FLAG_SKINNABLE);
RewardXPAtKill(killer, victim);
}
}

View File

@@ -740,7 +740,7 @@ void BattlegroundIC::HandleContestedNodes(ICNodePoint* nodePoint)
for (std::list<Creature*>::const_iterator itr = cannons.begin(); itr != cannons.end(); ++itr)
{
(*itr)->GetVehicleKit()->RemoveAllPassengers();
(*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
(*itr)->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
}
}
else if (nodePoint->nodeType == NODE_TYPE_WORKSHOP)
@@ -775,7 +775,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
gunshipHorde->GetCreatureListWithEntryInGrid(cannons, NPC_HORDE_GUNSHIP_CANNON, 150.0f);
for (std::list<Creature*>::const_iterator itr = cannons.begin(); itr != cannons.end(); ++itr)
(*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
(*itr)->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
for (uint8 u = 0; u < MAX_HANGAR_TELEPORTERS_SPAWNS; ++u)
{

View File

@@ -699,18 +699,18 @@ void BattlegroundSA::DemolisherStartState(bool start)
if (Creature* dem = GetBGCreature(i))
{
if (start)
dem->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
dem->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
else
dem->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
dem->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
}
for (uint8 i = BG_SA_GUN_1; i <= BG_SA_GUN_10; i++)
if (Creature* gun = GetBGCreature(i))
{
if (start)
gun->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
gun->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
else
gun->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
gun->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
}
// xinef: enable first gates damaging at start