summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatheus Macabu <mkbu95@gmail.com>2013-04-22 22:15:23 -0300
committerMatheus Macabu <mkbu95@gmail.com>2013-04-22 22:15:23 -0300
commit60cfb9545fbfa1301d147ba242a8048a0fbde758 (patch)
tree64cd1dc672bd786b23a06bed6725a3f42304bfcf
parentae8b835bae40e0d6908bae42c963d536534d3e93 (diff)
downloadhercules-60cfb9545fbfa1301d147ba242a8048a0fbde758.tar.gz
hercules-60cfb9545fbfa1301d147ba242a8048a0fbde758.tar.bz2
hercules-60cfb9545fbfa1301d147ba242a8048a0fbde758.tar.xz
hercules-60cfb9545fbfa1301d147ba242a8048a0fbde758.zip
Little fix to start_items. Thanks to lighta!
Signed-off-by: Matheus Macabu <mkbu95@gmail.com>
-rw-r--r--src/char/char.c4
-rw-r--r--src/common/mmo.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/char/char.c b/src/char/char.c
index ae65caa56..204397dd3 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -125,7 +125,7 @@ int max_connect_user = -1;
int gm_allow_group = -1;
int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
int start_zeny = 0;
-int start_items[64]; //32 starting items allowed [mkbu95]
+int start_items[MAX_START_ITEMS*2];
int guild_exp_rate = 100;
//Custom limits for the fame lists. [Skotlex]
@@ -4790,7 +4790,7 @@ int char_config_read(const char* cfgName)
i = 0;
split = strtok(w2, ",");
- while (split != NULL) {
+ while (split != NULL && i < MAX_START_ITEMS) {
split2 = split;
split = strtok(NULL, ",");
start_items[i] = atoi(split2);
diff --git a/src/common/mmo.h b/src/common/mmo.h
index c0842bac2..e19c8f94d 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -100,6 +100,7 @@
#define MAX_GUARDIANS 8 //Local max per castle. [Skotlex]
#define MAX_QUEST_DB 2400 //Max quests that the server will load
#define MAX_QUEST_OBJECTIVES 3 //Max quest objectives for a quest
+#define MAX_START_ITEMS 32 //Max number of items allowed to be given to a char whenever it's created. [mkbu95]
// for produce
#define MIN_ATTRIBUTE 0