*Add some missing contents in previous commits.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-04 17:14:34 -06:00
parent 13cfff2327
commit 1622cd26a1
10 changed files with 53 additions and 39 deletions
+13 -1
View File
@@ -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)
+1 -1
View File
@@ -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); }
+2
View File
@@ -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