Changed NPCTypes Data to bulk load when the zone loads or Repops, this bulk loading is stored in the npc_types cache

This commit is contained in:
Akkadius
2015-02-12 19:57:24 -06:00
parent 16002eb62e
commit 1966324112
12 changed files with 268 additions and 194 deletions
+4 -4
View File
@@ -203,7 +203,7 @@ void QuestManager::write(const char *file, const char *str) {
Mob* QuestManager::spawn2(int npc_type, int grid, int unused, const glm::vec4& position) {
const NPCType* tmp = 0;
if (tmp = database.GetNPCType(npc_type))
if (tmp = database.LoadNPCTypesData(npc_type))
{
NPC* npc = new NPC(tmp, nullptr, position, FlyMode3);
npc->AddLootTable();
@@ -225,7 +225,7 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const glm::v
}
const NPCType* tmp = 0;
if (tmp = database.GetNPCType(npc_type))
if (tmp = database.LoadNPCTypesData(npc_type))
{
NPC* npc = new NPC(tmp, nullptr, position, FlyMode3);
npc->AddLootTable();
@@ -275,7 +275,7 @@ Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id)
return nullptr;
}
const NPCType* tmp = database.GetNPCType(npcid);
const NPCType* tmp = database.LoadNPCTypesData(npcid);
if(!tmp)
{
return nullptr;
@@ -1574,7 +1574,7 @@ void QuestManager::respawn(int npcTypeID, int grid) {
quests_running_.push(e);
const NPCType* npcType = nullptr;
if ((npcType = database.GetNPCType(npcTypeID)))
if ((npcType = database.LoadNPCTypesData(npcTypeID)))
{
owner = new NPC(npcType, nullptr, owner->GetPosition(), FlyMode3);
owner->CastToNPC()->AddLootTable();