diff options
-rw-r--r-- | src/map/atcommand.c | 3 | ||||
-rw-r--r-- | src/map/script.c | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index d98ef8d94..e18b81f44 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1315,12 +1315,11 @@ ACMD(item2) } if (item_data->type == IT_PETARMOR) refine = 0; - if (refine > MAX_REFINE) - refine = MAX_REFINE; } else { identify = 1; refine = attr = 0; } + refine = cap_value(refine, 0, MAX_REFINE); for (i = 0; i < loop; i++) { memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; diff --git a/src/map/script.c b/src/map/script.c index 591bca68f..c48758db3 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7253,7 +7253,7 @@ BUILDIN(getitem2) if (item_data == NULL) return -1; if(item_data->type==IT_WEAPON || item_data->type==IT_ARMOR) { - if(ref > MAX_REFINE) ref = MAX_REFINE; + ref = cap_value(ref, 0, MAX_REFINE); } else if(item_data->type==IT_PETEGG) { iden = 1; |