diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 18 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 8 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 62 |
3 files changed, 46 insertions, 42 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f4c5e270a37..c7c56da7cff 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1723,18 +1723,18 @@ bool WorldObject::IsWithinDist3d(float x, float y, float z, float dist) const } bool WorldObject::IsWithinDist3d(const Position* pos, float dist) const -{ - return IsInDist(pos, dist + GetObjectSize()); +{ + return IsInDist(pos, dist + GetObjectSize()); } bool WorldObject::IsWithinDist2d(float x, float y, float dist) const { - return IsInDist2d(x, y, dist + GetObjectSize()); + return IsInDist2d(x, y, dist + GetObjectSize()); } bool WorldObject::IsWithinDist2d(const Position* pos, float dist) const -{ - return IsInDist2d(pos, dist + GetObjectSize()); +{ + return IsInDist2d(pos, dist + GetObjectSize()); } bool WorldObject::IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D /*= true*/) const @@ -2177,9 +2177,9 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo return true; } -bool WorldObject::CanNeverSee(WorldObject const* obj) const -{ - return GetMap() != obj->GetMap() || !InSamePhase(obj); +bool WorldObject::CanNeverSee(WorldObject const* obj) const +{ + return GetMap() != obj->GetMap() || !InSamePhase(obj); } bool WorldObject::CanDetect(WorldObject const* obj, bool ignoreStealth) const @@ -3222,7 +3222,7 @@ void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update) UpdateObjectVisibility(); } -bool WorldObject::InSamePhase(WorldObject const* obj) const +bool WorldObject::InSamePhase(WorldObject const* obj) const { return InSamePhase(obj->GetPhaseMask()); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3b0d15839a4..b49d81c16bc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10301,7 +10301,7 @@ Item* Player::GetItemByPos(uint8 bag, uint8 slot) const } //Does additional check for disarmed weapons -Item* Player::GetUseableItemByPos(uint8 bag, uint8 slot) const +Item* Player::GetUseableItemByPos(uint8 bag, uint8 slot) const { if (!CanUseAttackType(GetAttackBySlot(slot))) return NULL; @@ -16048,7 +16048,7 @@ void Player::RemoveQuestSlotState(uint16 slot, uint32 state) RemoveFlag(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_STATE_OFFSET, state); } -void Player::SetQuestSlotTimer(uint16 slot, uint32 timer) +void Player::SetQuestSlotTimer(uint16 slot, uint32 timer) { SetUInt32Value(PLAYER_QUEST_LOG_1_1 + slot * MAX_QUEST_OFFSET + QUEST_TIME_OFFSET, timer); } @@ -24023,6 +24023,10 @@ void Player::SetClientControl(Unit* target, uint8 allowMove) void Player::SetMover(Unit* target) { + m_mover->m_movedPlayer = NULL; + m_mover = target; + m_mover->m_movedPlayer = this; + ObjectGuid guid = target->GetGUID(); WorldPacket data(SMSG_MOVE_SET_ACTIVE_MOVER, 9); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f16aad73e42..a2b3a655785 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -452,9 +452,9 @@ void Unit::resetAttackTimer(WeaponAttackType type) } float Unit::GetMeleeReach() const -{ - float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; - return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; +{ + float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; + return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; } bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const @@ -512,14 +512,14 @@ AuraApplication * Unit::GetVisibleAura(uint8 slot) const void Unit::SetVisibleAura(uint8 slot, AuraApplication * aur) { - m_visibleAuras[slot]=aur; - UpdateAuraForGroup(slot); + m_visibleAuras[slot]=aur; + UpdateAuraForGroup(slot); } void Unit::RemoveVisibleAura(uint8 slot) { - m_visibleAuras.erase(slot); - UpdateAuraForGroup(slot); + m_visibleAuras.erase(slot); + UpdateAuraForGroup(slot); } void Unit::UpdateInterruptMask() @@ -2479,8 +2479,8 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spell, bool Ca } uint32 Unit::GetUnitMeleeSkill(Unit const* target) const -{ - return (target ? getLevelForTarget(target) : getLevel()) * 5; +{ + return (target ? getLevelForTarget(target) : getLevel()) * 5; } float Unit::GetUnitDodgeChance() const @@ -3943,7 +3943,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f AuraEffect* Unit::GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { - return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex); + return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex); } AuraApplication * Unit::GetAuraApplication(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, AuraApplication * except) const @@ -4470,35 +4470,35 @@ int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo float Unit::GetResistanceBuffMods(SpellSchools school, bool positive) const { - return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school); + return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school); } void Unit::SetResistanceBuffMods(SpellSchools school, bool positive, float val) { - SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val); + SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val); } void Unit::ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply) { - ApplyModSignedFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); + ApplyModSignedFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); } void Unit::ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply) { - ApplyPercentModFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); + ApplyPercentModFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); } void Unit::InitStatBuffMods() { for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) - SetFloatValue(UNIT_FIELD_POSSTAT0+i, 0); + SetFloatValue(UNIT_FIELD_POSSTAT0+i, 0); for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) - SetFloatValue(UNIT_FIELD_NEGSTAT0+i, 0); + SetFloatValue(UNIT_FIELD_NEGSTAT0+i, 0); } void Unit::ApplyStatBuffMod(Stats stat, float val, bool apply) { - ApplyModSignedFloatValue((val > 0 ? UNIT_FIELD_POSSTAT0+stat : UNIT_FIELD_NEGSTAT0+stat), val, apply); + ApplyModSignedFloatValue((val > 0 ? UNIT_FIELD_POSSTAT0+stat : UNIT_FIELD_NEGSTAT0+stat), val, apply); } void Unit::ApplyStatPercentBuffMod(Stats stat, float val, bool apply) @@ -8382,7 +8382,7 @@ Unit* Unit::GetCharm() const Unit* Unit::GetCharmerOrOwner() const { - return GetCharmerGUID() ? GetCharmer() : GetOwner(); + return GetCharmerGUID() ? GetCharmer() : GetOwner(); } Unit* Unit::GetCharmerOrOwnerOrSelf() const @@ -8769,14 +8769,14 @@ void Unit::RemoveAllControlled() sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID()); } -bool Unit::isPossessedByPlayer() const +bool Unit::isPossessedByPlayer() const { - return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); + return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } bool Unit::isPossessing(Unit* u) const { - return u->isPossessed() && GetCharmGUID() == u->GetGUID(); + return u->isPossessed() && GetCharmGUID() == u->GetGUID(); } bool Unit::isPossessing() const @@ -10996,7 +10996,7 @@ bool Unit::IsAlwaysDetectableFor(WorldObject const* seer) const bool Unit::IsVisible() const { - return (m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GM) > SEC_PLAYER) ? false : true; + return (m_serverSideVisibility.GetValue(SERVERSIDE_VISIBILITY_GM) > SEC_PLAYER) ? false : true; } void Unit::SetVisible(bool x) @@ -13567,9 +13567,9 @@ SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const return SPELL_SCHOOL_MASK_NORMAL; } -uint64 Unit::GetCharmerOrOwnerGUID() const +uint64 Unit::GetCharmerOrOwnerGUID() const { - return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); + return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); } uint64 Unit::GetCharmerOrOwnerOrOwnGUID() const @@ -15282,8 +15282,8 @@ void Unit::RestoreFaction() } Unit* Unit::GetRedirectThreatTarget() -{ - return _redirectThreadInfo.GetTargetGUID() ? GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL; +{ + return _redirectThreadInfo.GetTargetGUID() ? GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL; } bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry) @@ -15314,9 +15314,9 @@ void Unit::RemoveVehicleKit() RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PLAYER_VEHICLE); } -bool Unit::IsOnVehicle(const Unit* vehicle) const -{ - return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); +bool Unit::IsOnVehicle(const Unit* vehicle) const +{ + return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); } Unit* Unit::GetVehicleBase() const @@ -17112,8 +17112,8 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel } bool Unit::UpdatePosition(const Position &pos, bool teleport) -{ - return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); +{ + return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } //! Only server-side orientation update, does not broadcast to client |