diff options
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r-- | src/map/mercenary.c | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 84f6a3c41..c60234d5d 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -6,42 +6,43 @@ #include "mercenary.h" +#include "map/atcommand.h" +#include "map/battle.h" +#include "map/chrif.h" +#include "map/clif.h" +#include "map/guild.h" +#include "map/intif.h" +#include "map/itemdb.h" +#include "map/log.h" +#include "map/map.h" +#include "map/mob.h" +#include "map/npc.h" +#include "map/party.h" +#include "map/pc.h" +#include "map/pet.h" +#include "map/script.h" +#include "map/skill.h" +#include "map/status.h" +#include "map/trade.h" +#include "map/unit.h" +#include "common/cbasetypes.h" +#include "common/malloc.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/random.h" +#include "common/showmsg.h" +#include "common/socket.h" +#include "common/strlib.h" +#include "common/timer.h" +#include "common/utils.h" + #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" -#include "clif.h" -#include "guild.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" -#include "mob.h" -#include "npc.h" -#include "party.h" -#include "pc.h" -#include "pet.h" -#include "script.h" -#include "skill.h" -#include "status.h" -#include "trade.h" -#include "unit.h" -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/mmo.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/timer.h" -#include "../common/utils.h" - struct mercenary_interface mercenary_s; +struct s_mercenary_db mercdb[MAX_MERCENARY_CLASS]; int merc_search_index(int class_) { @@ -449,7 +450,7 @@ bool read_mercenarydb_sub(char* str[], int columns, int current) { } int read_mercenarydb(void) { - memset(mercenary->db,0,sizeof(mercenary->db)); + memset(mercenary->db, 0, sizeof(struct s_mercenary_db) * MAX_MERCENARY_CLASS); sv->readdb(map->db_path, "mercenary_db.txt", ',', 26, 26, MAX_MERCENARY_CLASS, mercenary->read_db_sub); return 0; @@ -511,7 +512,8 @@ void mercenary_defaults(void) { mercenary = &mercenary_s; /* vars */ - memset(mercenary->db,0,sizeof(mercenary->db)); + mercenary->db = mercdb; + memset(mercenary->db, 0, sizeof(struct s_mercenary_db) * MAX_MERCENARY_CLASS); /* funcs */ |