*Store creatureData and goData for creatures and gos.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-31 21:04:04 -05:00
parent 5034078d49
commit 76e4dfe8dd
6 changed files with 11 additions and 15 deletions

View File

@@ -57,6 +57,7 @@ GameObject::GameObject() : WorldObject(), m_goValue(new GameObjectValue)
m_charges = 5;
m_cooldownTime = 0;
m_goInfo = NULL;
m_goData = NULL;
m_DBTableGuid = 0;
}
@@ -628,8 +629,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
}
}
if(!data->dbData)
SetInternallyAdded();
m_goData = data;
return true;
}
@@ -647,11 +647,6 @@ GameObject* GameObject::GetGameObject(WorldObject& object, uint64 guid)
return object.GetMap()->GetGameObject(guid);
}
GameObjectInfo const *GameObject::GetGOInfo() const
{
return m_goInfo;
}
uint32 GameObject::GetLootId(GameObjectInfo const* ginfo)
{
if (!ginfo)
@@ -710,7 +705,7 @@ Unit* GameObject::GetOwner() const
void GameObject::SaveRespawnTime()
{
if(!m_isInternallyAdded && m_respawnTime > time(NULL) && m_spawnedByDefault)
if(m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault)
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
}