summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-31 20:46:54 +0200
committerHaru <haru@dotalux.com>2014-05-31 20:46:54 +0200
commite9b9764d1f6fc803319b7046a15f8d88aa2891b5 (patch)
tree6d6811c8e2400c477d45abff9f1662629ef375f5 /src
parent5b5281417ed8cbff625af9981860a16db23574e8 (diff)
downloadhercules-e9b9764d1f6fc803319b7046a15f8d88aa2891b5.tar.gz
hercules-e9b9764d1f6fc803319b7046a15f8d88aa2891b5.tar.bz2
hercules-e9b9764d1f6fc803319b7046a15f8d88aa2891b5.tar.xz
hercules-e9b9764d1f6fc803319b7046a15f8d88aa2891b5.zip
Corrected GM level override checks for Nouse and Trade
- Values are now clamped to the [0,100] range. Removed useless positivity check for item_usage.override (fixes a compiler warning). - Special thanks to KeiKun, ossi0110. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/itemdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index a095495d0..61b77748a 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1430,7 +1430,7 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
entry->flag.trade_restriction = ITR_NONE;
}
- if (entry->gm_lv_trade_override < 0) {
+ if (entry->gm_lv_trade_override < 0 || entry->gm_lv_trade_override > 100) {
ShowWarning("itemdb_validate_entry: Invalid trade-override GM level %d for item %d (%s) in '%s', defaulting to none.\n",
entry->gm_lv_trade_override, entry->nameid, entry->jname, source);
entry->gm_lv_trade_override = 0;
@@ -1446,7 +1446,7 @@ int itemdb_validate_entry(struct item_data *entry, int n, const char *source) {
entry->item_usage.flag = INR_NONE;
}
- if (entry->item_usage.override < 0) {
+ if (entry->item_usage.override > 100) {
ShowWarning("itemdb_validate_entry: Invalid nouse-override GM level %d for item %d (%s) in '%s', defaulting to none.\n",
entry->item_usage.override, entry->nameid, entry->jname, source);
entry->item_usage.override = 0;