*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

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)