diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-05-02 19:09:37 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-05-02 19:09:37 +0200 |
| commit | 081eab3cf5a5ec42917b2a7eaebf816fb36da423 (patch) | |
| tree | 2ece3e5dbe86a837468303f8363cc8da0f5a72f4 /src/server/game/Entities/Unit | |
| parent | f13de8083469742d62c2d74a49a76e35469d8fb0 (diff) | |
Core/Unit: UNIT_FLAG renames
[UNIT_FLAG_PLAYER_CONTROLLED -> UNIT_FLAG_POSSESSED]
[UNIT_FLAG_PVP_ATTACKABLE -> UNIT_FLAG_PLAYER_CONTROLLED]
Signed off by: Shauren, Warlockbugs.
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 34 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/UnitDefines.h | 6 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 029dd093193..bdcb80bcb0b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2003,7 +2003,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr if (attType != BASE_ATTACK && attType != OFF_ATTACK) return; // ignore ranged case - if (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISABLE_TURN)) + if (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED) && !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISABLE_TURN)) SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) // melee attack spell cast at main hand attack only - no normal melee dmg dealt @@ -2053,7 +2053,7 @@ void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BA if (attType != BASE_ATTACK && attType != OFF_ATTACK) return; // ignore ranged case - if (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED) && !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISABLE_TURN)) + if (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED) && !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISABLE_TURN)) SetFacingToObject(victim, false); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) CalcDamageInfo damageInfo; @@ -5854,7 +5854,7 @@ void Unit::SetMinion(Minion *minion, bool apply) if (GetTypeId() == TYPEID_PLAYER) { minion->m_ControlledByPlayer = true; - minion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + minion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); } // Can only have one pet. If a new one is summoned, dismiss the old one. @@ -6019,7 +6019,7 @@ void Unit::SetCharm(Unit* charm, bool apply) charm->m_ControlledByPlayer = true; /// @todo maybe we can use this flag to check if controlled by player - charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); } else charm->m_ControlledByPlayer = false; @@ -6055,19 +6055,19 @@ void Unit::SetCharm(Unit* charm, bool apply) if (charm->GetTypeId() == TYPEID_PLAYER) { charm->m_ControlledByPlayer = true; - charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charm->ToPlayer()->UpdatePvPState(); } else if (Player* player = charm->GetCharmerOrOwnerPlayerOrPlayerItself()) { charm->m_ControlledByPlayer = true; - charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charm->SetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, player->GetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG)); } else { charm->m_ControlledByPlayer = false; - charm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + charm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charm->SetByteValue(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, 0); } @@ -8221,10 +8221,10 @@ void Unit::SetImmuneToPC(bool apply, bool keepCombat) { std::list<CombatReference*> toEnd; for (auto const& pair : m_combatManager.GetPvECombatRefs()) - if (pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) + if (pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) toEnd.push_back(pair.second); for (auto const& pair : m_combatManager.GetPvPCombatRefs()) - if (pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) + if (pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) toEnd.push_back(pair.second); for (CombatReference* ref : toEnd) ref->EndCombat(); @@ -8249,10 +8249,10 @@ void Unit::SetImmuneToNPC(bool apply, bool keepCombat) { std::list<CombatReference*> toEnd; for (auto const& pair : m_combatManager.GetPvECombatRefs()) - if (!pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) + if (!pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) toEnd.push_back(pair.second); for (auto const& pair : m_combatManager.GetPvPCombatRefs()) - if (!pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) + if (!pair.second->GetOther(this)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) toEnd.push_back(pair.second); for (CombatReference* ref : toEnd) ref->EndCombat(); @@ -10752,7 +10752,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id) pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id); if (GetTypeId() == TYPEID_PLAYER) - pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); if (!pet->InitStatsForLevel(level)) { @@ -11441,12 +11441,12 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au switch (type) { case CHARM_TYPE_VEHICLE: - SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED); playerCharmer->SetClientControl(this, true); playerCharmer->VehicleSpellInitialize(); break; case CHARM_TYPE_POSSESS: - SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); + SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED); charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL); playerCharmer->SetClientControl(this, true); playerCharmer->PossessSpellInitialize(); @@ -11546,14 +11546,14 @@ void Unit::RemoveCharmedBy(Unit* charmer) case CHARM_TYPE_VEHICLE: playerCharmer->SetClientControl(this, false); playerCharmer->SetClientControl(charmer, true); - RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED); break; case CHARM_TYPE_POSSESS: ClearUnitState(UNIT_STATE_POSSESSED); playerCharmer->SetClientControl(this, false); playerCharmer->SetClientControl(charmer, true); charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL); - RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED); break; case CHARM_TYPE_CHARM: if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) @@ -12694,7 +12694,7 @@ bool Unit::CanSwim() const // 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 (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CANNOT_SWIM)) return false; - if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) // is player + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) // is player return true; if (HasFlag(UNIT_FIELD_FLAGS_2, 0x1000000)) return false; diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h index 4ae0f7b54f6..c2e97efde45 100644 --- a/src/server/game/Entities/Unit/UnitDefines.h +++ b/src/server/game/Entities/Unit/UnitDefines.h @@ -123,11 +123,11 @@ enum UnitFlags : uint32 UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable UNIT_FLAG_REMOVE_CLIENT_CONTROL = 0x00000004, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving) - UNIT_FLAG_PVP_ATTACKABLE = 0x00000008, // allow apply pvp rules to attackable state in addition to faction dependent state + UNIT_FLAG_PLAYER_CONTROLLED = 0x00000008, // controlled by player, use _IMMUNE_TO_PC instead of _IMMUNE_TO_NPC UNIT_FLAG_RENAME = 0x00000010, UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR5_NO_REAGENT_WHILE_PREP 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_PLAYER_CONTROLLED | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE UNIT_FLAG_IMMUNE_TO_PC = 0x00000100, // disables combat/assistance with PlayerCharacters (PC) - 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 @@ -144,7 +144,7 @@ enum UnitFlags : uint32 UNIT_FLAG_DISARMED = 0x00200000, // 3.0.3, disable melee spells casting..., "Required melee weapon" added to melee spells tooltip. UNIT_FLAG_CONFUSED = 0x00400000, UNIT_FLAG_FLEEING = 0x00800000, - UNIT_FLAG_PLAYER_CONTROLLED = 0x01000000, // used in spell Eyes of the Beast for pet... let attack by controlled creature + UNIT_FLAG_POSSESSED = 0x01000000, // under direct client control by a player (possess or vehicle) UNIT_FLAG_NOT_SELECTABLE = 0x02000000, UNIT_FLAG_SKINNABLE = 0x04000000, UNIT_FLAG_MOUNT = 0x08000000, |
