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 -6
View File
@@ -1426,14 +1426,12 @@ bool Zone::Depop(bool StartSpawnTimer) {
std::map<uint32,NPCType *>::iterator itr;
entity_list.Depop(StartSpawnTimer);
#ifdef DEPOP_INVALIDATES_NPC_TYPES_CACHE
// Refresh npctable, getting current info from database.
while(npctable.size()) {
itr=npctable.begin();
/* Refresh npctable (cache), getting current info from database. */
while(npctable.size()) {
itr = npctable.begin();
delete itr->second;
npctable.erase(itr);
}
#endif
return true;
}
@@ -2165,7 +2163,7 @@ void Zone::DoAdventureActions()
{
if(ds->assa_count >= RuleI(Adventure, NumberKillsForBossSpawn))
{
const NPCType* tmp = database.GetNPCType(ds->data_id);
const NPCType* tmp = database.LoadNPCTypesData(ds->data_id);
if(tmp)
{
NPC* npc = new NPC(tmp, nullptr, glm::vec4(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h), FlyMode3);