summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-19 21:19:12 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-19 21:53:40 +0300
commit6c73aa1b03b04d4d9a2ba9056b8583475856da12 (patch)
treea12e7ac7b7e6ae8410ba170d345a3022da0e51a5
parent07ff8c707f6077d40ca4665e14b63939d55b75cf (diff)
downloadhercules-6c73aa1b03b04d4d9a2ba9056b8583475856da12.tar.gz
hercules-6c73aa1b03b04d4d9a2ba9056b8583475856da12.tar.bz2
hercules-6c73aa1b03b04d4d9a2ba9056b8583475856da12.tar.xz
hercules-6c73aa1b03b04d4d9a2ba9056b8583475856da12.zip
Fixing detecting item id or item name in string.
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/itemdb.c6
-rw-r--r--src/map/map.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 93355faca..e15a65902 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18509,7 +18509,7 @@ static void clif_cashshop_db(void)
continue;
}
- if( name[0] == 'I' && name[1] == 'D' && strlen(name) <= 7 ) {
+ if (name[0] == 'I' && name[1] == 'D' && strlen(name) <= 12) {
if( !( data = itemdb->exists(atoi(name+2))) ) {
ShowWarning("cashshop_db: unknown item id '%s' in category '%s'\n", name+2, entry_name);
continue;
@@ -19700,7 +19700,7 @@ static bool clif_parse_roulette_db(void)
continue;
}
- if( name[0] == 'I' && name[1] == 'D' && strlen(name) <= 7 ) {
+ if (name[0] == 'I' && name[1] == 'D' && strlen(name) <= 12) {
if( !( data = itemdb->exists(atoi(name+2))) ) {
ShowWarning("roulette_db: unknown item id '%s' in category '%s'\n", name+2, entry_name);
continue;
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 04f25ae5b..5e447d4c0 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -873,7 +873,7 @@ static void itemdb_read_groups(void)
} else
itname = libconfig->setting_get_string_elem(itg,c - 1);
- if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 8 ) {
+ if (itname[0] == 'I' && itname[1] == 'D' && strlen(itname) <= 12) {
if( !( data = itemdb->exists(atoi(itname+2)) ) )
ShowWarning("itemdb_read_groups: unknown item ID '%d' in group '%s'!\n",atoi(itname+2),config_setting_name(itg));
} else if( !( data = itemdb->name2id(itname) ) )
@@ -1240,7 +1240,7 @@ static void itemdb_read_packages(void)
itname = config_setting_name(it);
- if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 8 ) {
+ if (itname[0] == 'I' && itname[1] == 'D' && strlen(itname) <= 12) {
if( !( data = itemdb->exists(atoi(itname+2)) ) )
ShowWarning("itemdb_read_packages: unknown item ID '%d' in package '%s'!\n",atoi(itname+2),config_setting_name(itg));
} else if( !( data = itemdb->name2id(itname) ) )
@@ -1491,7 +1491,7 @@ static void itemdb_read_chains(void)
while( (entry = libconfig->setting_get_elem(itc,c++)) ) {
const char *itname = config_setting_name(entry);
- if( itname[0] == 'I' && itname[1] == 'D' && strlen(itname) < 8 ) {
+ if (itname[0] == 'I' && itname[1] == 'D' && strlen(itname) <= 12) {
if( !( data = itemdb->exists(atoi(itname+2)) ) )
ShowWarning("itemdb_read_chains: unknown item ID '%d' in chain '%s'!\n",atoi(itname+2),name);
} else if( !( data = itemdb->name2id(itname) ) )
diff --git a/src/map/map.c b/src/map/map.c
index 3979ea90e..8ea059700 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -5461,7 +5461,7 @@ static int map_zone_str2itemid(const char *name)
if( !name )
return 0;
- if( name[0] == 'I' && name[1] == 'D' && strlen(name) < 8 ) {
+ if (name[0] == 'I' && name[1] == 'D' && strlen(name) <= 12) {
if( !( data = itemdb->exists(atoi(name+2))) ) {
return 0;
}
@@ -5479,7 +5479,7 @@ static unsigned short map_zone_str2skillid(const char *name)
if( !name )
return 0;
- if( name[0] == 'I' && name[1] == 'D' && strlen(name) < 8 ) {
+ if (name[0] == 'I' && name[1] == 'D' && strlen(name) <= 12) {
if( !skill->get_index((nameid = atoi(name+2))) )
return 0;
} else {