void mob_reload(void) {
struct mob_db *mdb_data[MAX_MOB_DB+1];
int i;
for (i = 0; i < MAX_MOB_DB; i++)
if (mob_db_data[i] && mob_db_data[i] != mob_dummy) {
mdb_data[i] = (struct mob_db*)aMalloc(sizeof(struct mob_db));
memcpy(mdb_data[i], mob_db_data[i], sizeof(struct mob_db));
}
//Mob skills need to be cleared before re-reading them. [Skotlex]
for (i = 0; i < MAX_MOB_DB; i++)
if (mob_db_data[i]) {
memset(&mob_db_data[i]->skill,0,sizeof(mob_db_data[i]->skill));
mob_db_data[i]->maxskill=0;
}
// Clear item_drop_ratio_db
for (i = 0; i < MAX_ITEMDB; i++) {
if (item_drop_ratio_db[i]) {
aFree(item_drop_ratio_db[i]);
item_drop_ratio_db[i] = NULL;
}
}
mob_load();
for (i = 0; i < MAX_MOB_DB; i++)
if (mob_db_data[i] && mob_db_data[i] != mob_dummy) {
ShowDebug("Comp:%d:%d\n",i,memcmp(mdb_data[i], mob_db_data[i], sizeof(struct mob_db)));
aFree(mdb_data[i]);
}
}