From 371d056df80b6f83484534f64883c3d020c4112d Mon Sep 17 00:00:00 2001 From: Emistry Haoyan Date: Sun, 16 Jun 2019 18:44:45 +0800 Subject: Sanitize handling of the input() values. - avoid potential hacks for old scripts that use `input()` script commands. Signed-off-by: Haru --- npc/other/comodo_gambling.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'npc/other/comodo_gambling.txt') 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."; -- cgit v1.2.3-70-g09d2