diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-17 23:46:36 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-08-17 23:47:43 +0200 |
| commit | da1e466bd5bf2e4f0778a9bfb6b60ae66e1a6ada (patch) | |
| tree | b9496b119d095c38d9c5137a4926ac132bb0f1e4 /src/server/game | |
| parent | 865353e4a61d7dc7c57f4fa699bf652e83286f4c (diff) | |
Core/Misc: Implemented GetObjectScale function
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.h | 1 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index b46ee4703db..2af7824cf98 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2631,7 +2631,7 @@ void Creature::SetDisplayId(uint32 modelId) if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId)) { - SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius * GetFloatValue(OBJECT_FIELD_SCALE_X)); - SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach * GetFloatValue(OBJECT_FIELD_SCALE_X)); + SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius * GetObjectScale()); + SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach * GetObjectScale()); } } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 2bfb9633066..4c48d80762d 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -134,6 +134,7 @@ class Object uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); } void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); } + float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); } virtual void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); } TypeID GetTypeId() const { return m_objectTypeId; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c57c5c9a076..2ff86f81880 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -26302,7 +26302,7 @@ float Player::GetCollisionHeight(bool mounted) const CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); ASSERT(modelData); - float scaleMod = GetFloatValue(OBJECT_FIELD_SCALE_X); // 99% sure about this + float scaleMod = GetObjectScale(); // 99% sure about this return scaleMod * mountModelData->MountHeight + modelData->CollisionHeight * 0.5f; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 20b6e67c5db..01de61f2b0f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2069,7 +2069,7 @@ void AuraEffect::HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, b Unit* target = aurApp->GetTarget(); - float scale = target->GetFloatValue(OBJECT_FIELD_SCALE_X); + float scale = target->GetObjectScale(); ApplyPercentModFloatVar(scale, float(GetAmount()), apply); target->SetObjectScale(scale); } @@ -2089,7 +2089,7 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode // What must be cloned? at least display and scale target->SetDisplayId(caster->GetDisplayId()); - //target->SetObjectScale(caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?) + //target->SetObjectScale(caster->GetObjectScale()); // we need retail info about how scaling is handled (aura maybe?) target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE); } else |
