summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-07 16:04:51 -0200
committershennetsind <ind@henn.et>2013-11-07 16:04:51 -0200
commitb9b32ac7609e33c21b488d722103cc0eea16b12c (patch)
treea2d96930f2f608a14374434e487c1f06ea703728 /src/map/atcommand.c
parent52864b40d6f9df5682b257ac2f36d645895364be (diff)
downloadhercules-b9b32ac7609e33c21b488d722103cc0eea16b12c.tar.gz
hercules-b9b32ac7609e33c21b488d722103cc0eea16b12c.tar.bz2
hercules-b9b32ac7609e33c21b488d722103cc0eea16b12c.tar.xz
hercules-b9b32ac7609e33c21b488d722103cc0eea16b12c.zip
Item Bound Fixes/Adjustments/Improvements
Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 3f3e9679e..e19428d36 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1104,7 +1104,7 @@ ACMD(item)
sscanf(message, "%99s %d %d", item_name, &number, &bound) < 2
))) {
clif->message(fd, msg_txt(295)); // Please enter an item name or ID (usage: @itembound <item name/ID> <quantity> <bound_type>).
- return -1;
+ return false;
} else if (!message || !*message || (
sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 &&
sscanf(message, "%99s %d", item_name, &number) < 1 ))
@@ -1123,7 +1123,7 @@ ACMD(item)
return false;
}
- if( bound < 0 || bound > 4 ) {
+ if( bound < IBT_MIN || bound > IBT_MAX ) {
clif->message(fd, msg_txt(298)); // Invalid bound type
return false;
}
@@ -1137,9 +1137,6 @@ ACMD(item)
return false;
}
get_count = 1;
- } else if( bound ) {
- clif->message(fd, msg_txt(499)); // Cannot create bounded stackable items.
- return false;
}
for (i = 0; i < number; i += get_count) {
@@ -1148,7 +1145,7 @@ ACMD(item)
memset(&item_tmp, 0, sizeof(item_tmp));
item_tmp.nameid = item_id;
item_tmp.identify = 1;
- item_tmp.bound = bound;
+ item_tmp.bound = (unsigned char)bound;
if ((flag = pc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
clif->additem(sd, 0, 0, flag);
@@ -1192,9 +1189,9 @@ ACMD(item2)
if (number <= 0)
number = 1;
- if( bound < 0 || bound > 4 ) {
+ if( bound < IBT_MIN || bound > IBT_MAX ) {
clif->message(fd, msg_txt(298)); // Invalid bound type
- return -1;
+ return false;
}
item_id = 0;
@@ -1225,10 +1222,6 @@ ACMD(item2)
if (refine > MAX_REFINE)
refine = MAX_REFINE;
} else {
- if( bound ) {
- clif->message(fd, msg_txt(499)); // Cannot create bounded stackable items.
- return false;
- }
identify = 1;
refine = attr = 0;
}
@@ -1238,11 +1231,12 @@ ACMD(item2)
item_tmp.identify = identify;
item_tmp.refine = refine;
item_tmp.attribute = attr;
+ item_tmp.bound = (unsigned char)bound;
item_tmp.card[0] = c1;
item_tmp.card[1] = c2;
item_tmp.card[2] = c3;
item_tmp.card[3] = c4;
- item_tmp.bound = bound;
+
if ((flag = pc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
clif->additem(sd, 0, 0, flag);
}