[10115] Add function to update model_info at changes to scale or model.

* At every change to model or scale, the related data (bounding_radius/combat_reach) is now updated accordingly (note that player combat_reach are not changed like creature).
* UpdateModelData is called from within SetDisplayId while changes to scale has explicit call to UpdateModelData after new scale is set (mostly for aura scale)
* The updated values are calculated by (scale*bounding_radius)/(scale*combat_reach)
* Database values for bounding_radius/combat_reach are expected to be relative to scale like 1.0

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-06-28 12:10:13 +02:00
parent 67a7892075
commit 1713caae17
8 changed files with 27 additions and 25 deletions

View file

@ -247,6 +247,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
SetDisplayId(display_id);
SetNativeDisplayId(display_id);
SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender);
// Load creature equipment
@ -264,9 +265,6 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
SetName(normalInfo->Name); // at normal entry always
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
SetSpeedRate(MOVE_WALK, cinfo->speed_walk);