[10145] Use better (but still hack) way for gameobject size calculation

* This is also hack because some float with unknown exactly value used as 'size'
* Another not resolved problem: go size used in creature target autoselection, so for large 'virtual' go
  creature can seelct strange points near in attempt select 'free' place near target.
This commit is contained in:
VladimirMangos 2010-07-03 23:08:32 +04:00
parent 35bf2a56dd
commit ebf27938fb
8 changed files with 25 additions and 9 deletions

View file

@ -1515,3 +1515,14 @@ bool GameObject::IsFriendlyTo(Unit const* unit) const
// common faction based case (GvC,GvP)
return tester_faction->IsFriendlyTo(*target_faction);
}
float GameObject::GetObjectBoundingRadius() const
{
//FIXME:
// 1. This is clearly hack way because GameObjectDisplayInfoEntry have 6 floats related to GO sizes, but better that use DEFAULT_WORLD_OBJECT_SIZE
// 2. In some cases this must be only interactive size, not GO size, current way can affect creature target point auto-selection in strange ways for big underground/virtual GOs
if (GameObjectDisplayInfoEntry const* dispEntry = sGameObjectDisplayInfoStore.LookupEntry(GetGOInfo()->displayId))
return fabs(dispEntry->unknown12) * GetObjectScale();
return DEFAULT_WORLD_OBJECT_SIZE;
}