diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-11-21 15:59:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-21 15:59:07 +0300 |
commit | e0bff9d14ccbdc5f0311539fd24a474e7e02741d (patch) | |
tree | 085bcf17d42535c93083dba8f5870c2223684fd6 /src/map/itemdb.c | |
parent | 511219ae00986d41586f99421fef2126325f1e15 (diff) | |
parent | c12429cd00ce531b2ff685c201d74e2576c2a4aa (diff) | |
download | hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.tar.gz hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.tar.bz2 hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.tar.xz hercules-e0bff9d14ccbdc5f0311539fd24a474e7e02741d.zip |
Merge pull request #1514 from HerculesWS/itemdb-fixes
Itemdb AegisName fixes
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 97f302b80..58397a2ee 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1540,6 +1540,30 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) { return 0; } + { + const char *c = entry->name; + while (ISALNUM(*c) || *c == '_') + ++c; + + if (*c != '\0') { + ShowWarning("itemdb_validate_entry: Invalid characters in the AegisName '%s' for item %d in '%s'. Skipping.\n", + entry->name, entry->nameid, source); + if (entry->script) { + script->free_code(entry->script); + entry->script = NULL; + } + if (entry->equip_script) { + script->free_code(entry->equip_script); + entry->equip_script = NULL; + } + if (entry->unequip_script) { + script->free_code(entry->unequip_script); + entry->unequip_script = NULL; + } + return 0; + } + } + if( entry->type < 0 || entry->type == IT_UNKNOWN || entry->type == IT_UNKNOWN2 || (entry->type > IT_DELAYCONSUME && entry->type < IT_CASH ) || entry->type >= IT_MAX ) { |