mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
67a7892075
commit
1713caae17
8 changed files with 27 additions and 25 deletions
|
|
@ -739,8 +739,6 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
|||
{
|
||||
pCreature->SetDisplayId(itr->second.modelid);
|
||||
pCreature->SetNativeDisplayId(itr->second.modelid);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -754,8 +752,6 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
|||
{
|
||||
pCreature->SetDisplayId(itr->second.modelid_prev);
|
||||
pCreature->SetNativeDisplayId(itr->second.modelid_prev);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue