diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 56de50cd0..fa1e150ef 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -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 }; diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 582494424..9aaf2097f 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -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"; diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 9b2c7e0f6..0834d18a1 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -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; +} \ No newline at end of file diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 657dad3df..d7a9ee6b8 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -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; } diff --git a/src/game/Object.h b/src/game/Object.h index 76611d6a2..c900e4d8c 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -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; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 8a17d2b7d..f2e5ed57b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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; diff --git a/src/game/Unit.h b/src/game/Unit.h index 704c93f43..9fbb2774e 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -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); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index aa4fa910b..49bdb6ae1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10144" + #define REVISION_NR "10145" #endif // __REVISION_NR_H__