summaryrefslogtreecommitdiff
path: root/src/map/mercenary.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r--src/map/mercenary.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index ffcb26629..ff37f396d 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -42,6 +42,9 @@
#include <string.h>
struct mercenary_interface mercenary_s;
+struct s_mercenary_db mercdb[MAX_MERCENARY_CLASS];
+
+struct mercenary_interface *mercenary;
int merc_search_index(int class_)
{
@@ -449,7 +452,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 +514,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 */