mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-03 13:36:36 +00:00
Make npc_spells_cache a map fixes #705
Should probably add a way to clear the cache, but we didn't do that before so I didn't bother.
This commit is contained in:
+2
-15
@@ -34,28 +34,15 @@ ZoneDatabase::ZoneDatabase(const char* host, const char* user, const char* passw
|
||||
|
||||
void ZoneDatabase::ZDBInitVars() {
|
||||
memset(door_isopen_array, 0, sizeof(door_isopen_array));
|
||||
npc_spells_maxid = 0;
|
||||
npc_spellseffects_maxid = 0;
|
||||
npc_spells_cache = 0;
|
||||
npc_spellseffects_cache = 0;
|
||||
npc_spells_loadtried = 0;
|
||||
npc_spellseffects_loadtried = 0;
|
||||
max_faction = 0;
|
||||
faction_array = nullptr;
|
||||
}
|
||||
|
||||
ZoneDatabase::~ZoneDatabase() {
|
||||
unsigned int x;
|
||||
if (npc_spells_cache) {
|
||||
for (x = 0; x <= npc_spells_maxid; x++) {
|
||||
safe_delete_array(npc_spells_cache[x]);
|
||||
}
|
||||
safe_delete_array(npc_spells_cache);
|
||||
}
|
||||
safe_delete_array(npc_spells_loadtried);
|
||||
|
||||
if (npc_spellseffects_cache) {
|
||||
for (x = 0; x <= npc_spellseffects_maxid; x++) {
|
||||
for (int x = 0; x <= npc_spellseffects_maxid; x++) {
|
||||
safe_delete_array(npc_spellseffects_cache[x]);
|
||||
}
|
||||
safe_delete_array(npc_spellseffects_cache);
|
||||
@@ -63,7 +50,7 @@ ZoneDatabase::~ZoneDatabase() {
|
||||
safe_delete_array(npc_spellseffects_loadtried);
|
||||
|
||||
if (faction_array != nullptr) {
|
||||
for (x = 0; x <= max_faction; x++) {
|
||||
for (int x = 0; x <= max_faction; x++) {
|
||||
if (faction_array[x] != 0)
|
||||
safe_delete(faction_array[x]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user