Skill caps load with new smem scheme

This commit is contained in:
KimLS
2013-02-20 13:54:26 -08:00
parent 12bde7434a
commit 8eb7d0aaa8
54 changed files with 311 additions and 253 deletions
+3 -4
View File
@@ -27,11 +27,10 @@
void LoadSpells(SharedDatabase *database) {
EQEmu::IPCMutex mutex("spells");
mutex.Lock();
int records = database->GetMaxSpellID();
if(records == -1) {
EQ_EXCEPT("Shared Memory", "Unable to get maximum number of spells from the database.");
int records = database->GetMaxSpellID() + 1;
if(records == 0) {
EQ_EXCEPT("Shared Memory", "Unable to get any spells from the database.");
}
++records;
uint32 size = records * sizeof(SPDat_Spell_Struct);
EQEmu::MemoryMappedFile mmf("shared/spells", size);