summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-03-27 22:59:33 -0300
committerJesusaves <cpntb1@ymail.com>2021-03-27 22:59:33 -0300
commit89e27df37d1314e3ae319600e389f2c4c7f07fb6 (patch)
tree37e7a22fa9bd48ccdfd54ee164b567f8af1bb8af
parent27d11067c0f896ffcd58701912109c9a1727c104 (diff)
downloadhercules-89e27df37d1314e3ae319600e389f2c4c7f07fb6.tar.gz
hercules-89e27df37d1314e3ae319600e389f2c4c7f07fb6.tar.bz2
hercules-89e27df37d1314e3ae319600e389f2c4c7f07fb6.tar.xz
hercules-89e27df37d1314e3ae319600e389f2c4c7f07fb6.zip
Revert "Add check for valid item amount to BUILDIN(rodex_sendmail)"
This reverts commit 77aef58085f166d0ce0b3b06d81dde9a35a05e0d. This reverts commit a1bb4008e58b92e2af5099570a723e37ea138d0b.
-rw-r--r--src/map/script.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 355735740..59331cfe1 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -25417,18 +25417,6 @@ static BUILDIN(rodex_sendmail)
return false;
}
- if (!data_isint(script_getdata(st, param + 1))) {
- ShowError("script:rodex_sendmail: Passed amount for item %d is not a number!\n", i + 1);
- return false;
- }
-
- int amount = script_getnum(st, param + 1);
-
- if (amount < 1 || amount > min(MAX_AMOUNT, SHRT_MAX)) {
- ShowError("script:rodex_sendmail: Invalid amount %d passed for item %d!\n", amount, i + 1);
- return false;
- }
-
++item_count;
if (data_isstring(script_getdata(st, param)) == false) {
int itemid = script_getnum(st, param);
@@ -25446,7 +25434,7 @@ static BUILDIN(rodex_sendmail)
}
msg.items[i].item.nameid = idata->nameid;
- msg.items[i].item.amount = amount;
+ msg.items[i].item.amount = script_getnum(st, (param + 1));
msg.items[i].item.identify = 1;
++i;
@@ -25486,19 +25474,6 @@ static BUILDIN(rodex_sendmail2)
ShowError("script:rodex_sendmail: Missing Item %d amount!\n", (i + 1));
return false;
}
-
- if (!data_isint(script_getdata(st, param + 1))) {
- ShowError("script:rodex_sendmail: Passed amount for item %d is not a number!\n", i + 1);
- return false;
- }
-
- int amount = script_getnum(st, param + 1);
-
- if (amount < 1 || amount > min(MAX_AMOUNT, SHRT_MAX)) {
- ShowError("script:rodex_sendmail: Invalid amount %d passed for item %d!\n", amount, i + 1);
- return false;
- }
-
if (!script_hasdata(st, param + 2)) {
ShowError("script:rodex_sendmail: Missing Item %d refine!\n", (i + 1));
return false;
@@ -25531,7 +25506,7 @@ static BUILDIN(rodex_sendmail2)
}
msg.items[i].item.nameid = idata->nameid;
- msg.items[i].item.amount = amount;
+ msg.items[i].item.amount = script_getnum(st, (param + 1));
msg.items[i].item.refine = script_getnum(st, (param + 2));
msg.items[i].item.attribute = script_getnum(st, (param + 3));
msg.items[i].item.identify = 1;