summaryrefslogtreecommitdiff
path: root/npc/other/comodo_gambling.txt
diff options
context:
space:
mode:
authorEmistry Haoyan <equinox1991@gmail.com>2019-06-16 18:44:45 +0800
committerHaru <haru@dotalux.com>2019-07-28 18:17:09 +0200
commit371d056df80b6f83484534f64883c3d020c4112d (patch)
tree20d38a8581f3a6159157bfa6644027d4007485bc /npc/other/comodo_gambling.txt
parentef8bc3a8375d4fe9a5f75faf951b3deecb891d57 (diff)
downloadhercules-371d056df80b6f83484534f64883c3d020c4112d.tar.gz
hercules-371d056df80b6f83484534f64883c3d020c4112d.tar.bz2
hercules-371d056df80b6f83484534f64883c3d020c4112d.tar.xz
hercules-371d056df80b6f83484534f64883c3d020c4112d.zip
Sanitize handling of the input() values.
- avoid potential hacks for old scripts that use `input()` script commands. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'npc/other/comodo_gambling.txt')
-rw-r--r--npc/other/comodo_gambling.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/npc/other/comodo_gambling.txt b/npc/other/comodo_gambling.txt
index bd2b0d692..dab52fbbc 100644
--- a/npc/other/comodo_gambling.txt
+++ b/npc/other/comodo_gambling.txt
@@ -540,14 +540,15 @@ mjolnir_02,85,362,3 script Blacksmith Miner 4_F_JOB_BLACKSMITH,{
mes "If you change your mind,";
mes "please enter '0' to cancel.";
next;
- input .@amount;
- if (.@amount == 0) {
+ input(.@amount);
+ if (.@amount <= 0) {
mes "[Dwayne]";
mes "Alright, you've";
mes "canceled the trade.";
mes "Take care!";
close;
- } else if (.@amount < 1 || .@amount > 500){
+ }
+ if (.@amount > 500) {
mes "[Dwayne]";
mes "The maximum";
mes "amount is 500.";