mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
35bf2a56dd
commit
ebf27938fb
8 changed files with 25 additions and 9 deletions
|
|
@ -867,7 +867,8 @@ struct GameObjectDisplayInfoEntry
|
|||
uint32 Displayid; // 0 m_ID
|
||||
// char* filename; // 1
|
||||
// uint32 unknown2[10]; // 2-11 unknown data
|
||||
// float unknown12[6]; // 12-17 unknown data
|
||||
float unknown12; // 12-17 unknown size data, use first value as interact dist, mostly in hacks way
|
||||
// float unknown13[5]; // 12-17 unknown size data
|
||||
// uint32 unknown18; // 18 unknown data
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const char EmotesEntryfmt[]="nxxiiix";
|
|||
const char EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx";
|
||||
const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiixxxxssssssssssssssssxxxxxxxxxxxxxxxxxx";
|
||||
const char FactionTemplateEntryfmt[]="niiiiiiiiiiiii";
|
||||
const char GameObjectDisplayInfofmt[]="nxxxxxxxxxxxxxxxxxx";
|
||||
const char GameObjectDisplayInfofmt[]="nxxxxxxxxxxxfxxxxxx";
|
||||
const char GemPropertiesEntryfmt[]="nixxi";
|
||||
const char GlyphPropertiesfmt[]="niii";
|
||||
const char GlyphSlotfmt[]="nii";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -660,6 +660,8 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); }
|
||||
void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); }
|
||||
|
||||
float GetObjectBoundingRadius() const; // overwrite WorldObject version
|
||||
|
||||
void Use(Unit* user);
|
||||
|
||||
LootState getLootState() const { return m_lootState; }
|
||||
|
|
|
|||
|
|
@ -371,10 +371,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
|||
GetNearPoint(obj, x, y, z, obj->GetObjectBoundingRadius(), distance2d, GetAngle(obj));
|
||||
}
|
||||
|
||||
float GetObjectBoundingRadius() const
|
||||
{
|
||||
return ( m_valuesCount > UNIT_FIELD_BOUNDINGRADIUS ) ? m_floatValues[UNIT_FIELD_BOUNDINGRADIUS] : DEFAULT_WORLD_OBJECT_SIZE;
|
||||
}
|
||||
virtual float GetObjectBoundingRadius() const { return DEFAULT_WORLD_OBJECT_SIZE; }
|
||||
|
||||
bool IsPositionValid() const;
|
||||
void UpdateGroundPositionZ(float x, float y, float &z) const;
|
||||
|
|
|
|||
|
|
@ -2312,8 +2312,8 @@ GameObject* Player::GetGameObjectIfCanInteractWith(ObjectGuid guid, uint32 gameo
|
|||
if (go->IsWithinDistInMap(this, maxdist) && go->isSpawned())
|
||||
return go;
|
||||
|
||||
sLog.outError("GetGameObjectIfCanInteractWith: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name,
|
||||
go->GetGUIDLow(), GetName(), GetGUIDLow(), go->GetDistance(this));
|
||||
sLog.outError("GetGameObjectIfCanInteractWith: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal %f is allowed)",
|
||||
go->GetGOInfo()->name, go->GetGUIDLow(), GetName(), GetGUIDLow(), go->GetDistance(this), maxdist);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -1110,6 +1110,11 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
|
||||
void CleanupsBeforeDelete(); // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
|
||||
|
||||
float GetObjectBoundingRadius() const // overwrite WorldObject version
|
||||
{
|
||||
return m_floatValues[UNIT_FIELD_BOUNDINGRADIUS];
|
||||
}
|
||||
|
||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||
void IncrDiminishing(DiminishingGroup group);
|
||||
void ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10144"
|
||||
#define REVISION_NR "10145"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue