diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-10-26 02:57:28 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-10-26 02:57:28 +0200 |
| commit | 9e1930959db59013d6f0221d29cc652cdf2f6145 (patch) | |
| tree | 29218cc6af11c18f645eba3503583ed821975b2c /src/server/game/Entities/GameObject | |
| parent | 747350a0bcffaa4ef2b5d3317bb75fac78c64472 (diff) | |
Core/Entities: Changed object lowguid to uint64
Diffstat (limited to 'src/server/game/Entities/GameObject')
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 19 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.h | 12 |
2 files changed, 16 insertions, 15 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index d179eb19c99..f5facec6ba4 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -54,7 +54,7 @@ GameObject::GameObject() : WorldObject(false), MapObject(), m_goInfo = NULL; m_goData = NULL; - m_DBTableGuid = 0; + m_DBTableGuid = UI64LIT(0); m_rotation = 0; m_groupLootTimer = 0; @@ -162,7 +162,7 @@ void GameObject::RemoveFromWorld() } } -bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 /*phaseMask*/, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit) +bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 /*phaseMask*/, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit) { ASSERT(map); SetMap(map); @@ -798,11 +798,11 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) uint8 index = 0; PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT); - stmt->setUInt32(0, m_DBTableGuid); + stmt->setUInt64(0, m_DBTableGuid); trans->Append(stmt); stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAMEOBJECT); - stmt->setUInt32(index++, m_DBTableGuid); + stmt->setUInt64(index++, m_DBTableGuid); stmt->setUInt32(index++, GetEntry()); stmt->setUInt16(index++, uint16(mapid)); stmt->setUInt8(index++, spawnMask); @@ -823,7 +823,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) WorldDatabase.CommitTransaction(trans); } -bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap) +bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType guid, Map* map, bool addToMap) { GameObjectData const* data = sObjectMgr->GetGOData(guid); @@ -851,7 +851,8 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap) uint32 artKit = data->artKit; m_DBTableGuid = guid; - if (map->GetInstanceId() != 0) guid = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT); + if (map->GetInstanceId() != 0) + guid = sObjectMgr->GetGenerator<HIGHGUID_GAMEOBJECT>()->Generate(); if (!Create(guid, entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit)) return false; @@ -911,13 +912,13 @@ void GameObject::DeleteFromDB() PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT); - stmt->setUInt32(0, m_DBTableGuid); + stmt->setUInt64(0, m_DBTableGuid); WorldDatabase.Execute(stmt); stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_EVENT_GAMEOBJECT); - stmt->setUInt32(0, m_DBTableGuid); + stmt->setUInt64(0, m_DBTableGuid); WorldDatabase.Execute(stmt); } @@ -1172,7 +1173,7 @@ void GameObject::SetGoArtKit(uint8 kit) data->artKit = kit; } -void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid) +void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid) { const GameObjectData* data = NULL; if (go) diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index b14d4049cb5..07df49485fc 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -655,7 +655,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map void RemoveFromWorld() override; void CleanupsBeforeDelete(bool finalCleanup = true) override; - bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0); + bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0); void Update(uint32 p_time) override; GameObjectTemplate const* GetGOInfo() const { return m_goInfo; } GameObjectData const* GetGOData() const { return m_goData; } @@ -665,7 +665,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map bool IsDynTransport() const; bool IsDestructibleBuilding() const; - uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } + ObjectGuid::LowType GetDBTableGUIDLow() const { return m_DBTableGuid; } void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f); @@ -674,8 +674,8 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map void SaveToDB(); void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask); - bool LoadFromDB(uint32 guid, Map* map) { return LoadGameObjectFromDB(guid, map, false); } - bool LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap = true); + bool LoadFromDB(ObjectGuid::LowType guid, Map* map) { return LoadGameObjectFromDB(guid, map, false); } + bool LoadGameObjectFromDB(ObjectGuid::LowType guid, Map* map, bool addToMap = true); void DeleteFromDB(); void SetOwnerGUID(ObjectGuid owner) @@ -737,7 +737,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map void SetGoArtKit(uint8 artkit); uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); } void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); } - static void SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid = 0); + static void SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid = UI64LIT(0)); void SetInPhase(uint32 id, bool update, bool apply); void EnableCollision(bool enable); @@ -868,7 +868,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map typedef std::map<uint32, ObjectGuid> ChairSlotAndUser; ChairSlotAndUser ChairListSlots; - uint32 m_DBTableGuid; ///< For new or temporary gameobjects is 0 for saved it is lowguid + ObjectGuid::LowType m_DBTableGuid; ///< For new or temporary gameobjects is 0 for saved it is lowguid GameObjectTemplate const* m_goInfo; GameObjectData const* m_goData; GameObjectValue m_goValue; |
