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
+3 -3
View File
@@ -142,7 +142,7 @@ void Trap::Trigger(Mob* trigger)
for (i = 0; i < effectvalue2; i++)
{
if ((tmp = database.GetNPCType(effectvalue)))
if ((tmp = database.LoadNPCTypesData(effectvalue)))
{
auto randomOffset = glm::vec4(zone->random.Int(-5, 5),zone->random.Int(-5, 5),zone->random.Int(-5, 5), zone->random.Int(0, 249));
auto spawnPosition = randomOffset + glm::vec4(m_Position, 0.0f);
@@ -165,7 +165,7 @@ void Trap::Trigger(Mob* trigger)
for (i = 0; i < effectvalue2; i++)
{
if ((tmp = database.GetNPCType(effectvalue)))
if ((tmp = database.LoadNPCTypesData(effectvalue)))
{
auto randomOffset = glm::vec4(zone->random.Int(-2, 2), zone->random.Int(-2, 2), zone->random.Int(-2, 2), zone->random.Int(0, 249));
auto spawnPosition = randomOffset + glm::vec4(m_Position, 0.0f);
@@ -294,7 +294,7 @@ void Trap::CreateHiddenTrigger()
if(hiddenTrigger)
return;
const NPCType *base_type = database.GetNPCType(500);
const NPCType *base_type = database.LoadNPCTypesData(500);
NPCType *make_npc = new NPCType;
memcpy(make_npc, base_type, sizeof(NPCType));
make_npc->max_hp = 100000;