diff options
| author | Shauren <none@none> | 2010-12-17 13:43:24 +0100 |
|---|---|---|
| committer | Shauren <none@none> | 2010-12-17 13:43:24 +0100 |
| commit | 82f45966fc00106b52294e4c01a2848ba24e2eb8 (patch) | |
| tree | dd3ee1457f54da1cdeebe3ded7e6e29f282d2bc9 /src/server/game | |
| parent | ee3fd3ebebcbf85d3ff942eb462b15368b76e8c1 (diff) | |
Core/Unit: Renamed addUnitState/hasUnitState/clearUnitState to AddUnitState/HasUnitState/ClearUnitState
Core/Vehicles: Allow the vehicle to always damage the passenger (removed unneded dbc hacks from scripts)
--HG--
branch : trunk
Diffstat (limited to 'src/server/game')
49 files changed, 229 insertions, 229 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index f54daa9367f..a36aa000b01 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -102,7 +102,7 @@ void CombatAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) @@ -161,7 +161,7 @@ void CasterAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index 59f6e2e0a75..dff7666d1c6 100755 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -61,13 +61,13 @@ void PossessedAI::KilledUnit(Unit* victim) void CritterAI::DamageTaken(Unit * /*done_by*/, uint32 &) { - if (!me->hasUnitState(UNIT_STAT_FLEEING)) + if (!me->HasUnitState(UNIT_STAT_FLEEING)) me->SetControlled(true, UNIT_STAT_FLEEING); } void CritterAI::EnterEvadeMode() { - if (me->hasUnitState(UNIT_STAT_FLEEING)) + if (me->HasUnitState(UNIT_STAT_FLEEING)) me->SetControlled(false, UNIT_STAT_FLEEING); CreatureAI::EnterEvadeMode(); } diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 31262d8eedd..c624773e90b 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -115,14 +115,14 @@ void PetAI::UpdateAI(const uint32 diff) else HandleReturnMovement(); } - else if (owner && !me->hasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim + else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim me->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; // Autocast (casted only in combat or persistent spells in any state) - if (me->GetGlobalCooldown() == 0 && !me->hasUnitState(UNIT_STAT_CASTING)) + if (me->GetGlobalCooldown() == 0 && !me->HasUnitState(UNIT_STAT_CASTING)) { typedef std::vector<std::pair<Unit*, Spell*> > TargetSpellList; TargetSpellList targetSpellStore; @@ -427,7 +427,7 @@ void PetAI::MovementInform(uint32 moveType, uint32 data) me->GetCharmInfo()->SetIsReturning(false); me->GetCharmInfo()->SetIsFollowing(true); me->GetCharmInfo()->SetIsCommandAttack(false); - me->addUnitState(UNIT_STAT_FOLLOW); + me->AddUnitState(UNIT_STAT_FOLLOW); } } break; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 17f87003dfc..5c6d8ff2715 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -38,7 +38,7 @@ void UnitAI::AttackStartCaster(Unit *victim, float dist) void UnitAI::DoMeleeAttackIfReady() { - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return; //Make sure our attack is ready and we aren't currently casting before checking distance @@ -64,7 +64,7 @@ void UnitAI::DoMeleeAttackIfReady() bool UnitAI::DoSpellAttackIfReady(uint32 spell) { - if (me->hasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STAT_CASTING)) return true; if (me->isAttackReady()) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index ae989fdb987..35537afa98e 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -576,7 +576,7 @@ inline bool CreatureAI::_EnterEvadeMode() inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || (me->hasUnitState(UNIT_STAT_CASTING) && !triggered)) + if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered)) return; me->CastSpell(victim, spellId, triggered); @@ -589,7 +589,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered) { - if (!triggered && me->hasUnitState(UNIT_STAT_CASTING)) + if (!triggered && me->HasUnitState(UNIT_STAT_CASTING)) return; me->CastSpell((Unit*)NULL, spellId, triggered); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index e69deffff52..c9960ee9545 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -580,7 +580,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (action.combat_movement.melee) { - me->addUnitState(UNIT_STAT_MELEE_ATTACKING); + me->AddUnitState(UNIT_STAT_MELEE_ATTACKING); me->SendMeleeAttackStart(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) @@ -594,7 +594,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 Unit* victim = me->getVictim(); if (action.combat_movement.melee && victim) { - me->clearUnitState(UNIT_STAT_MELEE_ATTACKING); + me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING); me->SendMeleeAttackStop(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 7717513d409..8ca697a1f46 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* pWho) void npc_escortAI::MoveInLineOfSight(Unit* pWho) { - if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) { if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho)) return; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index d9f753306cc..5dca322f8a0 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* pWho) me->SetInCombatWith(pWho); pWho->SetInCombatWith(me); - if (me->hasUnitState(UNIT_STAT_FOLLOW)) - me->clearUnitState(UNIT_STAT_FOLLOW); + if (me->HasUnitState(UNIT_STAT_FOLLOW)) + me->ClearUnitState(UNIT_STAT_FOLLOW); if (IsCombatMovement()) me->GetMotionMaster()->MoveChase(pWho); @@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* pWho) void FollowerAI::MoveInLineOfSight(Unit* pWho) { - if (!me->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && pWho->isInAccessiblePlaceFor(me)) { if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho)) return; @@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower() void FollowerAI::SetFollowComplete(bool bWithEndEvent) { - if (me->hasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STAT_FOLLOW)) { - me->clearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STAT_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); @@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool bPaused) { AddFollowState(STATE_FOLLOW_PAUSED); - if (me->hasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STAT_FOLLOW)) { - me->clearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STAT_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index e30585a9451..4fe047b0a7b 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -132,7 +132,7 @@ void HostileReference::updateOnlineStatus() // target is not in flight if (isValid() && ((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) || - !getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT))) + !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT))) { Creature* creature = getSourceUnit()->ToCreature(); online = getTarget()->isInAccessiblePlaceFor(creature); diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 2b14f147d2c..d892c023ff7 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1683,7 +1683,7 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/) error = LFG_TELEPORTERROR_INVALID_LOCATION; else if (!plr->isAlive()) error = LFG_TELEPORTERROR_PLAYER_DEAD; - else if (plr->IsFalling() || plr->hasUnitState(UNIT_STAT_JUMPING)) + else if (plr->IsFalling() || plr->HasUnitState(UNIT_STAT_JUMPING)) error = LFG_TELEPORTERROR_FALLING; else { diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1bd1e6fcff2..73899602157 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1541,7 +1541,7 @@ void Creature::setDeathState(DeathState s) if (GetCreatureInfo()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); - clearUnitState(UNIT_STAT_ALL_STATE); + ClearUnitState(UNIT_STAT_ALL_STATE); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); Motion_Initialize(); @@ -1604,7 +1604,7 @@ void Creature::Respawn(bool force) { setDeathState(JUST_DIED); i_motionMaster.Clear(); - clearUnitState(UNIT_STAT_ALL_STATE); + ClearUnitState(UNIT_STAT_ALL_STATE); LoadCreaturesAddon(true); } else @@ -1946,7 +1946,7 @@ bool Creature::_IsTargetAcceptable(const Unit *target) const // if the target cannot be attacked, the target is not acceptable if (IsFriendlyTo(target) || !target->isAttackableByAOE() - || target->hasUnitState(UNIT_STAT_DIED) + || target->HasUnitState(UNIT_STAT_DIED) || (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target)))) return false; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 6f6217ea1c8..461080177c3 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -473,7 +473,7 @@ class Creature : public Unit, public GridObject<Creature> uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support - bool IsInEvadeMode() const { return hasUnitState(UNIT_STAT_EVADE); } + bool IsInEvadeMode() const { return HasUnitState(UNIT_STAT_EVADE); } bool AIM_Initialize(CreatureAI* ai = NULL); void Motion_Initialize(); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 7f223dcd5bc..76c48050e13 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2379,7 +2379,7 @@ namespace Trinity float x,y,z; - if (!c->isAlive() || c->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) || + if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) || !c->GetMotionMaster()->GetDestination(x,y,z)) { x = c->GetPositionX(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9ed4bb35252..7809b005ca0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1330,7 +1330,7 @@ void Player::Update(uint32 p_time) GetAchievementMgr().UpdateTimedAchievements(p_time); - if (hasUnitState(UNIT_STAT_MELEE_ATTACKING) && !hasUnitState(UNIT_STAT_CASTING)) + if (HasUnitState(UNIT_STAT_MELEE_ATTACKING) && !HasUnitState(UNIT_STAT_CASTING)) { if (Unit *pVictim = getVictim()) { @@ -11023,7 +11023,7 @@ uint8 Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, boo { // May be here should be more stronger checks; STUNNED checked // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. - if (hasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STAT_STUNNED)) return EQUIP_ERR_YOU_ARE_STUNNED; // do not allow equipping gear except weapons, offhands, projectiles, relics in @@ -19395,7 +19395,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc return false; // not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root - if (GetSession()->isLogingOut() || isInCombat() || hasUnitState(UNIT_STAT_STUNNED) || hasUnitState(UNIT_STAT_ROOT)) + if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STAT_STUNNED) || HasUnitState(UNIT_STAT_ROOT)) { WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); data << uint32(ERR_TAXIPLAYERBUSY); @@ -20688,7 +20688,7 @@ void Player::SendInitialVisiblePackets(Unit* target) { if (target->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) target->SendMonsterMoveWithSpeedToCurrentDestination(this); - if (target->hasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim()) + if (target->HasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim()) target->SendMeleeAttackStart(target->getVictim()); } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index e8e3bb9328c..babc2f87f06 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1695,7 +1695,7 @@ class Player : public Unit, public GridObject<Player> void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;} void ResetContestedPvP() { - clearUnitState(UNIT_STAT_ATTACK_PLAYER); + ClearUnitState(UNIT_STAT_ATTACK_PLAYER); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); m_contestedPvPTimer = 0; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a92da8470b5..a79ef65d4ab 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -257,7 +257,7 @@ void Unit::Update(uint32 p_time) } //not implemented before 3.0.2 - //if (!hasUnitState(UNIT_STAT_CASTING)) + //if (!HasUnitState(UNIT_STAT_CASTING)) { if (uint32 base_att = getAttackTimer(BASE_ATTACK)) setAttackTimer(BASE_ATTACK, (p_time >= base_att ? 0 : base_att - p_time)); @@ -359,7 +359,7 @@ void Unit::SendMonsterStop(bool on_death) SendMessageToSet(&data, true); - clearUnitState(UNIT_STAT_MOVE); + ClearUnitState(UNIT_STAT_MOVE); } void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player) @@ -382,7 +382,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 T else SendMessageToSet(&data, true); - addUnitState(UNIT_STAT_MOVE); + AddUnitState(UNIT_STAT_MOVE); } void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player) @@ -513,12 +513,12 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb) { - if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) + if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) { - if (absorb) - *absorb += damage; - damage = 0; - return; + if (absorb) + *absorb += damage; + damage = 0; + return; } //You don't lose health from damage taken from another player while in a sanctuary @@ -1061,7 +1061,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss) if (!pVictim) return; - if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) + if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) return; SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID); @@ -1298,7 +1298,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) { Unit *pVictim = damageInfo->target; - if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) + if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && pVictim->GetVehicleBase() != this) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) return; //You don't lose health from damage taken from another player while in a sanctuary @@ -2236,7 +2236,7 @@ void Unit::CalcHealAbsorb(Unit *pVictim, const SpellEntry *healSpell, uint32 &he void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool extra) { - if (hasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) + if (HasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) return; if (!pVictim->isAlive()) @@ -2927,7 +2927,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const float Unit::GetUnitDodgeChance() const { - if (hasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STAT_STUNNED)) return 0.0f; if (GetTypeId() == TYPEID_PLAYER) return GetFloatValue(PLAYER_DODGE_PERCENTAGE); @@ -2946,7 +2946,7 @@ float Unit::GetUnitDodgeChance() const float Unit::GetUnitParryChance() const { - if (IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUNNED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED)) return 0.0f; float chance = 0.0f; @@ -2978,7 +2978,7 @@ float Unit::GetUnitParryChance() const float Unit::GetUnitBlockChance() const { - if (IsNonMeleeSpellCasted(false) || hasUnitState(UNIT_STAT_STUNNED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_STUNNED)) return 0.0f; if (GetTypeId() == TYPEID_PLAYER) @@ -3231,7 +3231,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - addUnitState(UNIT_STAT_CASTING); + AddUnitState(UNIT_STAT_CASTING); } break; case CURRENT_CHANNELED_SPELL: @@ -3244,7 +3244,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); - addUnitState(UNIT_STAT_CASTING); + AddUnitState(UNIT_STAT_CASTING); } break; case CURRENT_AUTOREPEAT_SPELL: @@ -9461,16 +9461,16 @@ bool Unit::Attack(Unit *victim, bool meleeAttack) // switch to melee attack from ranged/magic if (meleeAttack) { - if (!hasUnitState(UNIT_STAT_MELEE_ATTACKING)) + if (!HasUnitState(UNIT_STAT_MELEE_ATTACKING)) { - addUnitState(UNIT_STAT_MELEE_ATTACKING); + AddUnitState(UNIT_STAT_MELEE_ATTACKING); SendMeleeAttackStart(victim); return true; } } - else if (hasUnitState(UNIT_STAT_MELEE_ATTACKING)) + else if (HasUnitState(UNIT_STAT_MELEE_ATTACKING)) { - clearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STAT_MELEE_ATTACKING); SendMeleeAttackStop(victim); return true; } @@ -9480,7 +9480,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack) //switch target InterruptSpell(CURRENT_MELEE_SPELL); if (!meleeAttack) - clearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STAT_MELEE_ATTACKING); } if (m_attacking) @@ -9493,7 +9493,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack) SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID()); if (meleeAttack) - addUnitState(UNIT_STAT_MELEE_ATTACKING); + AddUnitState(UNIT_STAT_MELEE_ATTACKING); // set position before any AI calls/assistance //if (GetTypeId() == TYPEID_UNIT) @@ -9534,7 +9534,7 @@ bool Unit::AttackStop() // Clear our target SetUInt64Value(UNIT_FIELD_TARGET, 0); - clearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STAT_MELEE_ATTACKING); InterruptSpell(CURRENT_MELEE_SPELL); @@ -9577,7 +9577,7 @@ void Unit::CombatStopWithPets(bool includingCast) bool Unit::isAttackingPlayer() const { - if (hasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (HasUnitState(UNIT_STAT_ATTACK_PLAYER)) return true; for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) @@ -10949,7 +10949,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM // Judgement of Command proc always crits on stunned target if (spellProto->SpellFamilyName == SPELLFAMILY_PALADIN) if (spellProto->SpellFamilyFlags[0] & 0x0000000000800000LL && spellProto->SpellIconID == 561) - if (pVictim->hasUnitState(UNIT_STAT_STUNNED)) + if (pVictim->HasUnitState(UNIT_STAT_STUNNED)) return true; } } @@ -11930,7 +11930,7 @@ void Unit::Unmount() { if (Pet *pPet = this->ToPlayer()->GetPet()) { - if (pPet && pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->hasUnitState(UNIT_STAT_STUNNED)) + if (pPet && pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED)) pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } else @@ -12009,7 +12009,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) if (PvP) m_CombatTimer = 5000; - if (isInCombat() || hasUnitState(UNIT_STAT_EVADE)) + if (isInCombat() || HasUnitState(UNIT_STAT_EVADE)) return; SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); @@ -12060,7 +12060,7 @@ void Unit::ClearInCombat() if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);//re-apply Out of Combat Non Attackable flag if we leave combat, can be overriden in scripts in EnterEvadeMode() - clearUnitState(UNIT_STAT_ATTACK_PLAYER); + ClearUnitState(UNIT_STAT_ATTACK_PLAYER); if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED)) SetUInt32Value(UNIT_DYNAMIC_FLAGS, ((Creature*)this)->GetCreatureInfo()->dynamicflags); } @@ -12083,7 +12083,7 @@ void Unit::ClearInCombat() //TODO: remove this function bool Unit::isTargetableForAttack() const { - return isAttackableByAOE() && !hasUnitState(UNIT_STAT_DIED); + return isAttackableByAOE() && !HasUnitState(UNIT_STAT_DIED); } bool Unit::canAttack(Unit const* target, bool force) const @@ -12110,7 +12110,7 @@ bool Unit::canAttack(Unit const* target, bool force) const else if (!IsHostileTo(target)) return false; - if (!target->isAttackableByAOE() || target->hasUnitState(UNIT_STAT_DIED)) + if (!target->isAttackableByAOE() || target->HasUnitState(UNIT_STAT_DIED)) return false; if (m_vehicle) @@ -12132,7 +12132,7 @@ bool Unit::isAttackableByAOE(bool requireDeadTarget) const if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->isGameMaster()) return false; - return !hasUnitState(UNIT_STAT_UNATTACKABLE); + return !HasUnitState(UNIT_STAT_UNATTACKABLE); } int32 Unit::ModifyHealth(int32 dVal) @@ -14445,7 +14445,7 @@ void Unit::SendPetAIReaction(uint64 guid) void Unit::StopMoving() { - clearUnitState(UNIT_STAT_MOVING); + ClearUnitState(UNIT_STAT_MOVING); // send explicit stop packet // rely on vmaps here because for example stormwind is in air @@ -14804,16 +14804,16 @@ void Unit::SetContestedPvP(Player *attackedPlayer) return; player->SetContestedPvPTimer(30000); - if (!player->hasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (!player->HasUnitState(UNIT_STAT_ATTACK_PLAYER)) { - player->addUnitState(UNIT_STAT_ATTACK_PLAYER); + player->AddUnitState(UNIT_STAT_ATTACK_PLAYER); player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); // call MoveInLineOfSight for nearby contested guards UpdateObjectVisibility(); } - if (!hasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (!HasUnitState(UNIT_STAT_ATTACK_PLAYER)) { - addUnitState(UNIT_STAT_ATTACK_PLAYER); + AddUnitState(UNIT_STAT_ATTACK_PLAYER); // call MoveInLineOfSight for nearby contested guards UpdateObjectVisibility(); } @@ -15394,10 +15394,10 @@ void Unit::SetControlled(bool apply, UnitState state) { if (apply) { - if (hasUnitState(state)) + if (HasUnitState(state)) return; - addUnitState(state); + AddUnitState(state); switch(state) { case UNIT_STAT_STUNNED: @@ -15405,18 +15405,18 @@ void Unit::SetControlled(bool apply, UnitState state) CastStop(); break; case UNIT_STAT_ROOT: - if (!hasUnitState(UNIT_STAT_STUNNED)) + if (!HasUnitState(UNIT_STAT_STUNNED)) SetRooted(true); break; case UNIT_STAT_CONFUSED: - if (!hasUnitState(UNIT_STAT_STUNNED)) + if (!HasUnitState(UNIT_STAT_STUNNED)) { SetConfused(true); CastStop(); } break; case UNIT_STAT_FLEEING: - if (!hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) + if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) { SetFeared(true); CastStop(); @@ -15441,18 +15441,18 @@ void Unit::SetControlled(bool apply, UnitState state) default: return; } - clearUnitState(state); + ClearUnitState(state); - if (hasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STAT_STUNNED)) SetStunned(true); else { - if (hasUnitState(UNIT_STAT_ROOT)) + if (HasUnitState(UNIT_STAT_ROOT)) SetRooted(true); - if (hasUnitState(UNIT_STAT_CONFUSED)) + if (HasUnitState(UNIT_STAT_CONFUSED)) SetConfused(true); - else if (hasUnitState(UNIT_STAT_FLEEING)) + else if (HasUnitState(UNIT_STAT_FLEEING)) SetFeared(true); } } @@ -15488,7 +15488,7 @@ void Unit::SetStunned(bool apply) if (!pOwner || (pOwner->GetTypeId() == TYPEID_PLAYER && !pOwner->ToPlayer()->IsMounted())) RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - if (!hasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect + if (!HasUnitState(UNIT_STAT_ROOT)) // prevent allow move if have also root effect { WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4); data.append(GetPackGUID()); @@ -15519,7 +15519,7 @@ void Unit::SetRooted(bool apply) } else { - if (!hasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect + if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect { m_rootTimes++; //blizzard internal check? @@ -15604,7 +15604,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) return false; } - //if (hasUnitState(UNIT_STAT_UNATTACKABLE)) + //if (HasUnitState(UNIT_STAT_UNATTACKABLE)) // return false; if (GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->GetTransport()) @@ -15685,7 +15685,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) charmer->ToPlayer()->VehicleSpellInitialize(); break; case CHARM_TYPE_POSSESS: - addUnitState(UNIT_STAT_POSSESSED); + AddUnitState(UNIT_STAT_POSSESSED); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); charmer->ToPlayer()->SetClientControl(this, 1); @@ -15735,7 +15735,7 @@ void Unit::RemoveCharmedBy(Unit *charmer) } CharmType type; - if (hasUnitState(UNIT_STAT_POSSESSED)) + if (HasUnitState(UNIT_STAT_POSSESSED)) type = CHARM_TYPE_POSSESS; else if (charmer->IsOnVehicle(this)) type = CHARM_TYPE_VEHICLE; @@ -15753,7 +15753,7 @@ void Unit::RemoveCharmedBy(Unit *charmer) if (type == CHARM_TYPE_POSSESS) { - clearUnitState(UNIT_STAT_POSSESSED); + ClearUnitState(UNIT_STAT_POSSESSED); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index bc5d677f77f..75dad4686ac 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1169,12 +1169,12 @@ class Unit : public WorldObject void SendMeleeAttackStop(Unit* victim); void SendMeleeAttackStart(Unit* pVictim); - void addUnitState(uint32 f) { m_state |= f; } - bool hasUnitState(const uint32 f) const { return (m_state & f); } - void clearUnitState(uint32 f) { m_state &= ~f; } + void AddUnitState(uint32 f) { m_state |= f; } + bool HasUnitState(const uint32 f) const { return (m_state & f); } + void ClearUnitState(uint32 f) { m_state &= ~f; } bool CanFreeMove() const { - return !hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT | + return !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT | UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0; } @@ -1387,7 +1387,7 @@ class Unit : public WorldObject //Need fix or use this bool isGuard() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GUARD); } - bool isInFlight() const { return hasUnitState(UNIT_STAT_IN_FLIGHT); } + bool isInFlight() const { return HasUnitState(UNIT_STAT_IN_FLIGHT); } bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); } void CombatStart(Unit* target, bool initialAggro = true); @@ -1531,8 +1531,8 @@ class Unit : public WorldObject void RemoveAllControlled(); bool isCharmed() const { return GetCharmerGUID() != 0; } - bool isPossessed() const { return hasUnitState(UNIT_STAT_POSSESSED); } - bool isPossessedByPlayer() const { return hasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } + bool isPossessed() const { return HasUnitState(UNIT_STAT_POSSESSED); } + bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } bool isPossessing() const { if (Unit *u = GetCharm()) @@ -1766,7 +1766,7 @@ class Unit : public WorldObject bool isInFrontInMap(Unit const* target,float distance, float arc = M_PI) const; void SetInFront(Unit const* target) { - if (!hasUnitState(UNIT_STAT_CANNOT_TURN)) + if (!HasUnitState(UNIT_STAT_CANNOT_TURN)) SetOrientation(GetAngle(target)); } bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const; @@ -1900,7 +1900,7 @@ class Unit : public WorldObject MotionMaster* GetMotionMaster(){ return &i_motionMaster; } - bool IsStopped() const { return !(hasUnitState(UNIT_STAT_MOVING)); } + bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); } void StopMoving(); void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 0cea5c99506..f6be128a239 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -311,7 +311,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) } if (seat->second.seatInfo->m_flags && !(seat->second.seatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK11)) - unit->addUnitState(UNIT_STAT_ONVEHICLE); + unit->AddUnitState(UNIT_STAT_ONVEHICLE); unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); VehicleSeatEntry const *veSeat = seat->second.seatInfo; @@ -392,7 +392,7 @@ void Vehicle::RemovePassenger(Unit *unit) ++m_usableSeatNum; } - unit->clearUnitState(UNIT_STAT_ONVEHICLE); + unit->ClearUnitState(UNIT_STAT_ONVEHICLE); if (me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 2bb846c9533..68d0f9a724d 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -116,7 +116,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) if (!u->isAlive() || !c->isAlive() || c == u || u->isInFlight()) return; - if (c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS)) + if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STAT_SIGHTLESS)) if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true)) c->AI()->MoveInLineOfSight_Safe(u); } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index e4ca3b5018f..9122a0deb48 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -735,7 +735,7 @@ namespace Trinity bool operator()(Unit* u) { if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && - (u->isFeared() || u->isCharmed() || u->isFrozen() || u->hasUnitState(UNIT_STAT_STUNNED) || u->hasUnitState(UNIT_STAT_CONFUSED))) + (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED))) { return true; } diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 4ee7fd69f76..41b48f23c08 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -94,11 +94,11 @@ class ObjectWorldLoader uint32 i_corpses; }; -template<class T> void addUnitState(T* /*obj*/, CellPair const& /*cell_pair*/) +template<class T> void AddUnitState(T* /*obj*/, CellPair const& /*cell_pair*/) { } -template<> void addUnitState(Creature *obj, CellPair const& cell_pair) +template<> void AddUnitState(Creature *obj, CellPair const& cell_pair) { Cell cell(cell_pair); @@ -109,7 +109,7 @@ template <class T> void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj) { obj->GetGridRef().link(&m, obj); - addUnitState(obj,cell); + AddUnitState(obj,cell); obj->AddToWorld(); if (obj->isActiveObject()) map->AddToActive(obj); diff --git a/src/server/game/Movement/DestinationHolderImp.h b/src/server/game/Movement/DestinationHolderImp.h index 9ce32a382f3..9702625fbaf 100755 --- a/src/server/game/Movement/DestinationHolderImp.h +++ b/src/server/game/Movement/DestinationHolderImp.h @@ -109,10 +109,10 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff, GetLocationNowNoMicroMovement(x, y, z); else { - if (!traveller.GetTraveller().hasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT)) + if (!traveller.GetTraveller().HasUnitState(UNIT_STAT_MOVING | UNIT_STAT_IN_FLIGHT)) return true; - if (traveller.GetTraveller().hasUnitState(UNIT_STAT_IN_FLIGHT)) + if (traveller.GetTraveller().HasUnitState(UNIT_STAT_IN_FLIGHT)) GetLocationNow(traveller.GetTraveller().GetBaseMap() ,x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation else GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, false); diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index f906ac38c00..58e4fa1b804 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -79,7 +79,7 @@ MotionMaster::~MotionMaster() void MotionMaster::UpdateMotion(uint32 diff) { - if (i_owner->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included? + if (i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included? return; ASSERT(!empty()); m_cleanFlag |= MMCF_UPDATE; @@ -197,7 +197,7 @@ MotionMaster::MoveRandom(float spawndist) void MotionMaster::MoveTargetedHome() { - //if (i_owner->hasUnitState(UNIT_STAT_FLEEING)) + //if (i_owner->HasUnitState(UNIT_STAT_FLEEING)) // return; Clear(false); @@ -236,7 +236,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle) if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - i_owner->clearUnitState(UNIT_STAT_FOLLOW); + i_owner->ClearUnitState(UNIT_STAT_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog.outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", @@ -262,7 +262,7 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slo if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - i_owner->addUnitState(UNIT_STAT_FOLLOW); + i_owner->AddUnitState(UNIT_STAT_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog.outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(), @@ -329,7 +329,7 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee if (i_owner->IsNonMeleeSpellCasted(true)) i_owner->InterruptNonMeleeSpells(true); - i_owner->addUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING); + i_owner->AddUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING); i_owner->m_TempSpeed = speedXY; if (i_owner->GetTypeId() == TYPEID_PLAYER) { @@ -352,7 +352,7 @@ MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id) if (Impl[MOTION_SLOT_CONTROLLED] && Impl[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE) return; - i_owner->addUnitState(UNIT_STAT_CHARGING); + i_owner->AddUnitState(UNIT_STAT_CHARGING); i_owner->m_TempSpeed = speed; if (i_owner->GetTypeId() == TYPEID_PLAYER) { diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 50b328aada9..05d589b1b21 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -90,7 +90,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit) unit.CastStop(); unit.StopMoving(); unit.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - unit.addUnitState(UNIT_STAT_CONFUSED); + unit.AddUnitState(UNIT_STAT_CONFUSED); } template<> @@ -126,7 +126,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff) if (!&unit) return true; - if (unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) return true; if (i_nextMoveTime.Passed()) @@ -138,7 +138,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff) if (i_destinationHolder.HasArrived()) { // arrived, stop and wait a bit - unit.clearUnitState(UNIT_STAT_MOVE); + unit.ClearUnitState(UNIT_STAT_MOVE); i_nextMove = urand(1,MAX_CONF_WAYPOINTS); i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher @@ -168,7 +168,7 @@ void ConfusedMovementGenerator<T>::Finalize(T &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.clearUnitState(UNIT_STAT_CONFUSED); + unit.ClearUnitState(UNIT_STAT_CONFUSED); if (unit.GetTypeId() == TYPEID_UNIT && unit.getVictim()) unit.SetUInt64Value(UNIT_FIELD_TARGET, unit.getVictim()->GetGUID()); } diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index eee2053723e..6961476f171 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -33,7 +33,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner) if (!&owner) return; - if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) return; if (!_setMoveData(owner)) @@ -43,7 +43,7 @@ FleeingMovementGenerator<T>::_setTargetLocation(T &owner) if (!_getPoint(owner, x, y, z)) return; - owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); + owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); Traveller<T> traveller(owner); i_destinationHolder.SetDestination(traveller, x, y, z); } @@ -302,7 +302,7 @@ FleeingMovementGenerator<T>::Initialize(T &owner) _Init(owner); owner.CastStop(); - owner.addUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); + owner.AddUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); owner.SetUInt64Value(UNIT_FIELD_TARGET, 0); owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); @@ -351,7 +351,7 @@ void FleeingMovementGenerator<T>::Finalize(T &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); + owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); if (owner.GetTypeId() == TYPEID_UNIT && owner.getVictim()) owner.SetUInt64Value(UNIT_FIELD_TARGET, owner.getVictim()->GetGUID()); } @@ -369,7 +369,7 @@ FleeingMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) { if (!&owner || !owner.isAlive()) return false; - if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) return true; Traveller<T> traveller(owner); @@ -412,7 +412,7 @@ template bool FleeingMovementGenerator<Creature>::Update(Creature &, const uint3 void TimedFleeingMovementGenerator::Finalize(Unit &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.clearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); + owner.ClearUnitState(UNIT_STAT_FLEEING | UNIT_STAT_ROAMING); if (Unit* victim = owner.getVictim()) { if (owner.isAlive()) @@ -428,7 +428,7 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 & time_dif if (!owner.isAlive()) return false; - if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) return true; i_totalFleeTime.Update(time_diff); diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 2fcfff29792..9051a1d2116 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -29,7 +29,7 @@ HomeMovementGenerator<Creature>::Initialize(Creature & owner) float x, y, z; owner.GetHomePosition(x, y, z, ori); owner.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - owner.addUnitState(UNIT_STAT_EVADE); + owner.AddUnitState(UNIT_STAT_EVADE); _setTargetLocation(owner); } @@ -44,7 +44,7 @@ HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) if (!&owner) return; - if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) return; float x, y, z; @@ -54,7 +54,7 @@ HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner) uint32 travel_time = i_destinationHolder.SetDestination(traveller, x, y, z); modifyTravelTime(travel_time); - owner.clearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE); + owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE); } bool @@ -77,7 +77,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff owner.SendMessageToSet(&packet, false); } - owner.clearUnitState(UNIT_STAT_EVADE); + owner.ClearUnitState(UNIT_STAT_EVADE); owner.LoadCreaturesAddon(true); owner.AI()->JustReachedHome(); return false; diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 9cb130cb8b1..e20e919d775 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -32,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner) void IdleMovementGenerator::Reset(Unit& owner) { - if (owner.hasUnitState(UNIT_STAT_MOVE)) + if (owner.HasUnitState(UNIT_STAT_MOVE)) owner.StopMoving(); } void RotateMovementGenerator::Initialize(Unit& owner) { - if (owner.hasUnitState(UNIT_STAT_MOVE)) + if (owner.HasUnitState(UNIT_STAT_MOVE)) owner.StopMoving(); if (owner.getVictim()) owner.SetInFront(owner.getVictim()); - owner.addUnitState(UNIT_STAT_ROTATING); + owner.AddUnitState(UNIT_STAT_ROTATING); owner.AttackStop(); } @@ -75,7 +75,7 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff) void RotateMovementGenerator::Finalize(Unit &unit) { - unit.clearUnitState(UNIT_STAT_ROTATING); + unit.ClearUnitState(UNIT_STAT_ROTATING); if (unit.GetTypeId() == TYPEID_UNIT) unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0); } @@ -83,13 +83,13 @@ void RotateMovementGenerator::Finalize(Unit &unit) void DistractMovementGenerator::Initialize(Unit& owner) { - owner.addUnitState(UNIT_STAT_DISTRACTED); + owner.AddUnitState(UNIT_STAT_DISTRACTED); } void DistractMovementGenerator::Finalize(Unit& owner) { - owner.clearUnitState(UNIT_STAT_DISTRACTED); + owner.ClearUnitState(UNIT_STAT_DISTRACTED); } bool @@ -105,7 +105,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) void AssistanceDistractMovementGenerator::Finalize(Unit &unit) { - unit.clearUnitState(UNIT_STAT_DISTRACTED); + unit.ClearUnitState(UNIT_STAT_DISTRACTED); unit.ToCreature()->SetReactState(REACT_AGGRESSIVE); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index dc59f56383c..ad6cfc2011c 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -30,7 +30,7 @@ void PointMovementGenerator<T>::Initialize(T &unit) unit.StopMoving(); Traveller<T> traveller(unit); // knockback effect has UNIT_STAT_JUMPING set,so if here we disable sentmonstermove there will be creature position sync problem between client and server - i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.hasUnitState(UNIT_STAT_JUMPING)*/); + i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.HasUnitState(UNIT_STAT_JUMPING)*/); } template<class T> @@ -39,9 +39,9 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff) if (!&unit) return false; - if (unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) { - if (unit.hasUnitState(UNIT_STAT_CHARGING)) + if (unit.HasUnitState(UNIT_STAT_CHARGING)) return false; else return true; @@ -53,7 +53,7 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff) if (i_destinationHolder.HasArrived()) { - unit.clearUnitState(UNIT_STAT_MOVE); + unit.ClearUnitState(UNIT_STAT_MOVE); arrived = true; return false; } @@ -64,8 +64,8 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff) template<class T> void PointMovementGenerator<T>:: Finalize(T &unit) { - if (unit.hasUnitState(UNIT_STAT_CHARGING)) - unit.clearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING); + if (unit.HasUnitState(UNIT_STAT_CHARGING)) + unit.ClearUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING); if (arrived) // without this crash! MovementInform(unit); } diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 4c342c89504..1b53feeeda7 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -115,7 +115,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) Traveller<Creature> traveller(creature); creature.SetOrientation(creature.GetAngle(nx,ny)); i_destinationHolder.SetDestination(traveller, nx, ny, nz); - creature.addUnitState(UNIT_STAT_ROAMING); + creature.AddUnitState(UNIT_STAT_ROAMING); if (is_air_ok) { i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); @@ -164,20 +164,20 @@ template<> bool RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff) { - if (creature.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (creature.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) { i_nextMoveTime.Update(i_nextMoveTime.GetExpiry()); // Expire the timer - creature.clearUnitState(UNIT_STAT_ROAMING); + creature.ClearUnitState(UNIT_STAT_ROAMING); return true; } i_nextMoveTime.Update(diff); if (i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly()) - creature.clearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE); + creature.ClearUnitState(UNIT_STAT_ROAMING | UNIT_STAT_MOVE); if (!i_destinationHolder.HasArrived() && creature.IsStopped()) - creature.addUnitState(UNIT_STAT_ROAMING); + creature.AddUnitState(UNIT_STAT_ROAMING); CreatureTraveller traveller(creature); diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index da3c1fe32a8..dd747829f96 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -55,7 +55,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) if (!i_target.isValid() || !i_target->IsInWorld()) return false; - if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) return false; float x, y, z; @@ -70,7 +70,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) if (i_target->IsWithinMeleeRange(&owner)) return false; } - else if (!i_angle && !owner.hasUnitState(UNIT_STAT_FOLLOW)) + else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW)) { if (i_target->IsWithinDistInMap(&owner, i_offset)) return false; @@ -89,7 +89,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) if (i_target->IsWithinMeleeRange(&owner, 0)) stop = true; } - else if (!i_angle && !owner.hasUnitState(UNIT_STAT_FOLLOW)) + else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW)) { if (i_target->IsWithinDist(&owner, i_offset * 0.8f)) stop = true; @@ -114,7 +114,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) // to nearest random contact position i_target->GetRandomContactPoint(&owner, x, y, z, 0, MELEE_RANGE - 0.5f); } - else if (!i_angle && !owner.hasUnitState(UNIT_STAT_FOLLOW)) + else if (!i_angle && !owner.HasUnitState(UNIT_STAT_FOLLOW)) { // caster chase i_target->GetContactPoint(&owner, x, y, z, i_offset * urand(80, 95) * 0.01f); @@ -142,7 +142,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) return; */ i_destinationHolder.SetDestination(traveller, x, y, z); - owner.addUnitState(UNIT_STAT_CHASE); + owner.AddUnitState(UNIT_STAT_CHASE); i_destinationHolder.StartTravel(traveller); return true; } @@ -161,7 +161,7 @@ template<class T> void TargetedMovementGenerator<T>::Finalize(T &owner) { - owner.clearUnitState(UNIT_STAT_CHASE); + owner.ClearUnitState(UNIT_STAT_CHASE); } template<class T> @@ -181,11 +181,11 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) if (!&owner || !owner.isAlive()) return true; - if (owner.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED)) + if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_DISTRACTED)) return true; // prevent movement while casting spells with cast time or channel time - if (owner.hasUnitState(UNIT_STAT_CASTING)) + if (owner.HasUnitState(UNIT_STAT_CASTING)) { if (!owner.IsStopped()) owner.StopMoving(); @@ -193,7 +193,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) } // prevent crash after creature killed pet - if (!owner.hasUnitState(UNIT_STAT_FOLLOW) && owner.getVictim() != i_target.getTarget()) + if (!owner.HasUnitState(UNIT_STAT_FOLLOW) && owner.getVictim() != i_target.getTarget()) return true; Traveller<T> traveller(owner); @@ -202,7 +202,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) _setTargetLocation(owner); else if (owner.IsStopped() && !i_destinationHolder.HasArrived()) { - owner.addUnitState(UNIT_STAT_CHASE); + owner.AddUnitState(UNIT_STAT_CHASE); i_destinationHolder.StartTravel(traveller); return true; } @@ -217,7 +217,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) if (i_targetX != i_target->GetPositionX() || i_targetY != i_target->GetPositionY() || i_targetZ != i_target->GetPositionZ()) { - if (_setTargetLocation(owner) || !owner.hasUnitState(UNIT_STAT_FOLLOW)) + if (_setTargetLocation(owner) || !owner.HasUnitState(UNIT_STAT_FOLLOW)) owner.SetInFront(i_target.getTarget()); i_target->GetPosition(i_targetX, i_targetY, i_targetZ); } @@ -229,7 +229,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) owner.SetInFront(i_target.getTarget()); owner.StopMoving(); - if (owner.IsWithinMeleeRange(i_target.getTarget()) && !owner.hasUnitState(UNIT_STAT_FOLLOW)) + if (owner.IsWithinMeleeRange(i_target.getTarget()) && !owner.HasUnitState(UNIT_STAT_FOLLOW)) owner.Attack(i_target.getTarget(),true); } } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 2ae01325ea2..e574352a6a5 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -90,7 +90,7 @@ void WaypointMovementGenerator<Creature>::InitTraveller(Creature &unit, const Wa if (unit.canFly()) unit.SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - unit.addUnitState(UNIT_STAT_ROAMING); + unit.AddUnitState(UNIT_STAT_ROAMING); } template<> @@ -143,7 +143,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff - if (unit.hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) return true; // Clear the generator if the path doesn't exist @@ -205,7 +205,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) i_destinationHolder.ResetTravelTime(); MovementInform(unit); unit.UpdateWaypointID(i_currentNode); - unit.clearUnitState(UNIT_STAT_ROAMING); + unit.ClearUnitState(UNIT_STAT_ROAMING); unit.Relocate(node->x, node->y, node->z); } } @@ -248,7 +248,7 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const void FlightPathMovementGenerator::Initialize(Player &player) { player.getHostileRefManager().setOnlineOfflineState(false); - player.addUnitState(UNIT_STAT_IN_FLIGHT); + player.AddUnitState(UNIT_STAT_IN_FLIGHT); player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); Traveller<Player> traveller(player); // do not send movement, it was sent already @@ -260,7 +260,7 @@ void FlightPathMovementGenerator::Initialize(Player &player) void FlightPathMovementGenerator::Finalize(Player & player) { - player.clearUnitState(UNIT_STAT_IN_FLIGHT); + player.ClearUnitState(UNIT_STAT_IN_FLIGHT); float x = 0; float y = 0; diff --git a/src/server/game/Movement/Traveller.h b/src/server/game/Movement/Traveller.h index 09a4625c50c..edd700cc322 100755 --- a/src/server/game/Movement/Traveller.h +++ b/src/server/game/Movement/Traveller.h @@ -73,7 +73,7 @@ inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z) template<> inline float Traveller<Creature>::Speed() { - if (i_traveller.hasUnitState(UNIT_STAT_CHARGING)) + if (i_traveller.HasUnitState(UNIT_STAT_CHARGING)) return i_traveller.m_TempSpeed; else if (i_traveller.HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) return i_traveller.GetSpeed(MOVE_WALK); @@ -113,7 +113,7 @@ inline void Traveller<Creature>::MoveTo(float x, float y, float z, uint32 t) template<> inline float Traveller<Player>::Speed() { - if (i_traveller.hasUnitState(UNIT_STAT_CHARGING)) + if (i_traveller.HasUnitState(UNIT_STAT_CHARGING)) return i_traveller.m_TempSpeed; else if (i_traveller.isInFlight()) return PLAYER_FLIGHT_SPEED; diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index dc75bdbb6f3..1ecb0a001c5 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -45,7 +45,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendAuctionHello(guid, unit); @@ -162,7 +162,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item *it = pl->GetItemByGuid(item); @@ -273,7 +273,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject *auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); @@ -391,7 +391,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); @@ -476,7 +476,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); @@ -523,7 +523,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); @@ -576,7 +576,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr.GetAuctionsMap(pCreature->getFaction()); diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index a07c2c20c28..d7c07af8109 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -875,7 +875,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow()); - if (!pCurrChar->IsStandState() && !pCurrChar->hasUnitState(UNIT_STAT_STUNNED)) + if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); m_playerLoading = false; diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index feb13f59a06..1f0c1788646 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -473,7 +473,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data) { - if (!GetPlayer()->isAlive() || GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STAT_DIED)) return; uint32 emote; @@ -550,7 +550,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) break; default: // Only allow text-emotes for "dead" entities (feign death included) - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) break; GetPlayer()->HandleEmoteCommand(emote_anim); break; diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index 56671262ae8..d66bab0ad5f 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -302,7 +302,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER)) { // Remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (Guild* pGuild = _GetPlayerGuild(this)) diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index c89f60b1abe..b179ce5152e 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -502,7 +502,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item *pItem = _player->GetItemByGuid(itemguid); @@ -607,7 +607,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item *pItem = _player->GetItemFromBuyBackSlot(slot); @@ -725,11 +725,11 @@ void WorldSession::SendListInventory(uint64 vendorguid) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // Stop the npc if moving - if (pCreature->hasUnitState(UNIT_STAT_MOVING)) + if (pCreature->HasUnitState(UNIT_STAT_MOVING)) pCreature->StopMoving(); VendorItemData const* vItems = pCreature->GetVendorItems(); diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 6546a604d09..90ff51bcf88 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -122,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index a4b7909e2b1..c36745ffdf7 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -59,7 +59,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendTabardVendorActivate(guid); @@ -88,7 +88,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendShowBank(guid); @@ -127,7 +127,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // trainer list loaded at check; @@ -251,7 +251,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!unit->isCanTrainingOf(_player,true)) @@ -318,7 +318,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); // remove fake death - //if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + //if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) // GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider()) @@ -373,7 +373,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!code.empty()) @@ -404,7 +404,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendSpiritResurrect(); @@ -459,7 +459,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendBindPoint(unit); @@ -504,7 +504,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) return; // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // remove mounts this fix bug where getting pet from stable while mounted deletes pet. @@ -603,7 +603,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Pet *pet = _player->GetPet(); @@ -669,7 +669,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); m_unstablePetCallback.SetParam(petnumber); @@ -745,7 +745,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (GetPlayer()->m_stableSlots < MAX_PET_STABLES) @@ -784,7 +784,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Pet* pet = _player->GetPet(); @@ -869,7 +869,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // reputation discount diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 080ec2d68ee..82bf2e10f2f 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -197,7 +197,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid return; } - pet->clearUnitState(UNIT_STAT_FOLLOW); + pet->ClearUnitState(UNIT_STAT_FOLLOW); // This is true if pet has no target or has target but targets differs. if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack())) { @@ -765,7 +765,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) targets.read(recvPacket, caster); HandleClientCastFlags(recvPacket, castFlags, targets); - caster->clearUnitState(UNIT_STAT_FOLLOW); + caster->ClearUnitState(UNIT_STAT_FOLLOW); Spell *spell = new Spell(caster, spellInfo, false); spell->m_cast_count = castCount; // probably pending spell cast diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index 37bb3efe62e..5385f35aa9c 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -97,7 +97,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); uint32 charterid = 0; @@ -886,7 +886,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); uint8 count = 0; diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 98ecd8ad526..d3bdebbdbeb 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -98,7 +98,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // Stop the npc if moving pCreature->StopMoving(); diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 326dcba60e7..9f4780a6aa7 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -68,7 +68,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!(_player->resetTalents())) diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp index 4b301987f36..15937a4b54c 100755 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp @@ -80,7 +80,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // unknown taxi node case @@ -119,7 +119,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode) { // remove fake death - if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index 2de33d342da..19e59978d8e 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -556,7 +556,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (GetPlayer()->hasUnitState(UNIT_STAT_STUNNED)) + if (GetPlayer()->HasUnitState(UNIT_STAT_STUNNED)) { SendTradeStatus(TRADE_STATUS_YOU_STUNNED); return; @@ -608,7 +608,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther->hasUnitState(UNIT_STAT_STUNNED)) + if (pOther->HasUnitState(UNIT_STAT_STUNNED)) { SendTradeStatus(TRADE_STATUS_TARGET_STUNNED); return; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index af7bbfe175a..93dd29b99be 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1075,7 +1075,7 @@ void AuraEffect::Update(uint32 diff, Unit * caster) std::list<AuraApplication*> effectApplications; GetApplicationList(effectApplications); // tick on targets of effects - if (!caster || !caster->hasUnitState(UNIT_STAT_ISOLATED)) + if (!caster || !caster->HasUnitState(UNIT_STAT_ISOLATED)) { for (std::list<AuraApplication*>::iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr) PeriodicTick(*apptItr, caster); @@ -1258,7 +1258,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1415,7 +1415,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1498,7 +1498,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1531,7 +1531,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1640,7 +1640,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1753,7 +1753,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1793,7 +1793,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -1829,7 +1829,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (!target->isAlive()) return; - if (target->hasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STAT_ISOLATED)) { SendTickImmune(target, caster); return; @@ -3424,7 +3424,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher); for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter) { - if (!(*iter)->hasUnitState(UNIT_STAT_CASTING)) + if (!(*iter)->HasUnitState(UNIT_STAT_CASTING)) continue; for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) @@ -3443,7 +3443,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo // blizz like 2.0.x target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->addUnitState(UNIT_STAT_DIED); + target->AddUnitState(UNIT_STAT_DIED); target->CombatStop(); target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION); @@ -3468,7 +3468,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo // blizz like 2.0.x target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->clearUnitState(UNIT_STAT_DIED); + target->ClearUnitState(UNIT_STAT_DIED); } } @@ -4482,7 +4482,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin if (GetSpellProto()->Mechanic == MECHANIC_BANISH) { if (apply) - target->addUnitState(UNIT_STAT_ISOLATED); + target->AddUnitState(UNIT_STAT_ISOLATED); else { bool banishFound = false; @@ -4494,7 +4494,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin break; } if (!banishFound) - target->clearUnitState(UNIT_STAT_ISOLATED); + target->ClearUnitState(UNIT_STAT_ISOLATED); } } } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 21cad6bdd3f..711f8744d2e 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1823,7 +1823,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit * caster) if (modOwner) modOwner->ApplySpellMod(GetId(), SPELLMOD_RADIUS, radius); - if (!GetUnitOwner()->hasUnitState(UNIT_STAT_ISOLATED)) + if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED)) { switch(GetSpellProto()->Effect[effIndex]) { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a0dee3630d1..7f287015cb8 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1415,7 +1415,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool } // assisting case, healing and resurrection - if (unit->hasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER)) { m_caster->SetContestedPvP(); if (m_caster->GetTypeId() == TYPEID_PLAYER) @@ -3357,8 +3357,8 @@ void Spell::cast(bool skipCheck) m_spellState = SPELL_STATE_DELAYED; SetDelayStart(0); - if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) - m_caster->clearUnitState(UNIT_STAT_CASTING); + if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->ClearUnitState(UNIT_STAT_CASTING); } else { @@ -3731,8 +3731,8 @@ void Spell::finish(bool ok) if (IsChanneledSpell(m_spellInfo)) m_caster->UpdateInterruptMask(); - if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) - m_caster->clearUnitState(UNIT_STAT_CASTING); + if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->ClearUnitState(UNIT_STAT_CASTING); // Unsummon summon as possessed creatures on spell cancel if (IsChanneledSpell(m_spellInfo) && m_caster->GetTypeId() == TYPEID_PLAYER) @@ -4870,8 +4870,8 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_IsTriggeredSpell && m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState), m_spellInfo, m_caster)) return SPELL_FAILED_TARGET_AURASTATE; - // Not allow casting on flying player - if (target->hasUnitState(UNIT_STAT_UNATTACKABLE)) + // Not allow casting on flying player or on vehicle player (if caster isnt vehicle) + if (target->HasUnitState(UNIT_STAT_IN_FLIGHT) || (target->HasUnitState(UNIT_STAT_ONVEHICLE) && target->GetVehicleBase() != m_caster)) return SPELL_FAILED_BAD_TARGETS; if (!m_IsTriggeredSpell && !m_caster->canSeeOrDetect(target)) @@ -5225,7 +5225,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953)) m_caster->RemoveMovementImpairingAuras(); } - if (m_caster->hasUnitState(UNIT_STAT_ROOT)) + if (m_caster->HasUnitState(UNIT_STAT_ROOT)) return SPELL_FAILED_ROOTED; break; } @@ -5426,7 +5426,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; Unit* target = m_targets.getUnitTarget(); - if (m_caster == target && m_caster->hasUnitState(UNIT_STAT_ROOT)) + if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_ROOTED; @@ -5652,7 +5652,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD)) return SPELL_FAILED_CASTER_DEAD; - if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast + if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast return SPELL_FAILED_SPELL_IN_PROGRESS; if (m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo)) return SPELL_FAILED_AFFECTING_COMBAT; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c5d9179f78a..380771a4061 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1320,7 +1320,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } //Any effect which causes you to lose control of your character will supress the starfall effect. - if (m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED)) + if (m_caster->HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED)) return; m_caster->CastSpell(unitTarget, damage, true); @@ -3241,7 +3241,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) return; // target must be OK to do this - if (unitTarget->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING)) + if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING)) return; float angle = unitTarget->GetAngle(&m_targets.m_dstPos); @@ -6178,7 +6178,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); pet->setDeathState(ALIVE); - pet->clearUnitState(UNIT_STAT_ALL_STATE); + pet->ClearUnitState(UNIT_STAT_ALL_STATE); pet->SetHealth(pet->CountPctFromMaxHealth(damage)); //pet->AIM_Initialize(); |
