diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/GameObject.cpp | 14 | ||||
-rw-r--r-- | src/game/GameObject.h | 2 | ||||
-rw-r--r-- | src/game/Object.cpp | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 53a7d36aef4..a888ba6ec5b 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -162,6 +162,8 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, float x, float SetGoAnimProgress(animprogress); + SetByteValue(GAMEOBJECT_BYTES_1, 2, ArtKit); + // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22) if (goinfo->type == GAMEOBJECT_TYPE_SPELLCASTER) m_charges = goinfo->spellcaster.charges; @@ -539,6 +541,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask) data.animprogress = GetGoAnimProgress(); data.go_state = GetGoState(); data.spawnMask = spawnMask; + data.ArtKit = GetGoArtKit(); // updated in DB std::ostringstream ss; @@ -589,11 +592,12 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) uint32 animprogress = data->animprogress; uint32 go_state = data->go_state; + uint32 ArtKit = data->ArtKit; m_DBTableGuid = guid; if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT); - if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state) ) + if (!Create(guid,entry, map, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, ArtKit) ) return false; switch(GetGOInfo()->type) @@ -858,6 +862,14 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore) } +void GameObject::SetGoArtKit(uint8 kit) +{ + SetByteValue(GAMEOBJECT_BYTES_1, 2, kit); + GameObjectData *data = const_cast<GameObjectData*>(objmgr.GetGOData(m_DBTableGuid)); + if(data) + data->ArtKit = kit; +} + void GameObject::SwitchDoorOrButton(bool activate) { if(activate) diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 9a570eb54da..8638ba602bb 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -516,7 +516,7 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject uint8 GetGoState() const { return GetByteValue(GAMEOBJECT_BYTES_1, 0); } void SetGoState(uint8 state) { SetByteValue(GAMEOBJECT_BYTES_1, 0, state); } uint8 GetGoArtKit() const { return GetByteValue(GAMEOBJECT_BYTES_1, 2); } - void SetGoArtKit(uint8 artkit) { SetByteValue(GAMEOBJECT_BYTES_1, 2, artkit); } + void SetGoArtKit(uint8 artkit); uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); } void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 84440eec34b..7eedfdcdefb 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -570,6 +570,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask IsActivateToQuest = true; updateMask->SetBit(GAMEOBJECT_DYNAMIC); } + if (((GameObject*)this)->GetGoArtKit()) + updateMask->SetBit(GAMEOBJECT_BYTES_1); } } else //case UPDATETYPE_VALUES |