[6.x] Fix camera and player collision not updating when object scale changes (#17529)

This commit is contained in:
Krudor
2016-07-06 21:30:59 +02:00
committed by Shauren
parent be461280d2
commit 147d77102c
2 changed files with 10 additions and 6 deletions

View File

@@ -1761,6 +1761,15 @@ void Player::RemoveFromWorld()
}
}
void Player::SetObjectScale(float scale)
{
Unit::SetObjectScale(scale);
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, scale * DEFAULT_WORLD_OBJECT_SIZE);
SetFloatValue(UNIT_FIELD_COMBATREACH, scale * DEFAULT_COMBAT_REACH);
if (IsInWorld())
SendMovementSetCollisionHeight(scale * GetCollisionHeight(IsMounted()));
}
bool Player::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const
{
SpellEffectInfo const* effect = spellInfo->GetEffect(GetMap()->GetDifficultyID(), index);

View File

@@ -1199,12 +1199,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void AddToWorld() override;
void RemoveFromWorld() override;
void SetObjectScale(float scale) override
{
Unit::SetObjectScale(scale);
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, scale * DEFAULT_WORLD_OBJECT_SIZE);
SetFloatValue(UNIT_FIELD_COMBATREACH, scale * DEFAULT_COMBAT_REACH);
}
void SetObjectScale(float scale) override;
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options = 0);
bool TeleportTo(WorldLocation const &loc, uint32 options = 0);