diff options
author | Haru <haru@dotalux.com> | 2016-03-06 21:10:20 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-03-06 21:10:20 +0100 |
commit | a3ad5b4d9fe01b5a17999078bc1cb566c6f5c813 (patch) | |
tree | d67d1076d0aa36df8a412691d47a17a4391e9184 /src/map/itemdb.c | |
parent | dbebf2dcaaabd65b20722becdf7b4bb3ee682688 (diff) | |
parent | 4f6b2ebd825282937015efabbd35fc2cc6d992db (diff) | |
download | hercules-a3ad5b4d9fe01b5a17999078bc1cb566c6f5c813.tar.gz hercules-a3ad5b4d9fe01b5a17999078bc1cb566c6f5c813.tar.bz2 hercules-a3ad5b4d9fe01b5a17999078bc1cb566c6f5c813.tar.xz hercules-a3ad5b4d9fe01b5a17999078bc1cb566c6f5c813.zip |
Merge pull request #1189 from 4144/itemdbview
Check allowed range for "View" field in item_db for weapon items.
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 20efb5e9e..630bc4488 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1613,6 +1613,12 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) { memset(&entry->stack, '\0', sizeof(entry->stack)); } + if (entry->type == IT_WEAPON && (entry->look < 0 || entry->look >= MAX_SINGLE_WEAPON_TYPE)) { + ShowWarning("itemdb_validate_entry: Invalid View for weapon items. View value %d for item %d (%s) in '%s', defaulting to 1.\n", + entry->look, entry->nameid, entry->jname, source); + entry->look = 1; + } + entry->wlv = cap_value(entry->wlv, REFINE_TYPE_ARMOR, REFINE_TYPE_MAX); if( !entry->elvmax ) |