diff options
author | malufett <malufett.eat.my.binaries@gmail.com> | 2015-08-02 04:54:11 +0800 |
---|---|---|
committer | malufett <malufett.eat.my.binaries@gmail.com> | 2015-08-02 04:54:11 +0800 |
commit | e900608cc45f33399b12f109548da515df82e723 (patch) | |
tree | 3669888c564fe0527650cccd92af744058290b4a /src/map/mercenary.c | |
parent | cca4271c9350203bffa2feeb753708f434b71d41 (diff) | |
parent | f780bc47486289acd70fee5dc4f34efca1440eaa (diff) | |
download | hercules-e900608cc45f33399b12f109548da515df82e723.tar.gz hercules-e900608cc45f33399b12f109548da515df82e723.tar.bz2 hercules-e900608cc45f33399b12f109548da515df82e723.tar.xz hercules-e900608cc45f33399b12f109548da515df82e723.zip |
Merge pull request #601 from 4144/hpmreduce
Reduce map server memory usage for 3 MB with loaded HPM
Diffstat (limited to 'src/map/mercenary.c')
-rw-r--r-- | src/map/mercenary.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c index ffcb26629..c60234d5d 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -42,6 +42,7 @@ #include <string.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 */ |