summaryrefslogtreecommitdiff
path: root/npc/other/arena/arena_room.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/arena/arena_room.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/arena/arena_room.txt')
-rw-r--r--npc/other/arena/arena_room.txt11
1 files changed, 6 insertions, 5 deletions
diff --git a/npc/other/arena/arena_room.txt b/npc/other/arena/arena_room.txt
index b8806e112..b70ce7e4c 100644
--- a/npc/other/arena/arena_room.txt
+++ b/npc/other/arena/arena_room.txt
@@ -520,9 +520,9 @@ sec_in02,72,180,3 script Arena Manager#arena 4_NFWISP,{
//mes "If not, please enter a value for minutes first and then seconds.";
mes "Please enter a value for minutes first and then seconds.";
next;
- input .@arenamin;
+ input(.@arenamin, 0);
setd .@min$,.@arenamin;
- input .@arenasec;
+ input(.@arenasec, 0);
setd .@sec$,.@arenasec;
mes "[Arena Manager]";
mes "Current "+.@mode$+" ranker's play time has been rearranged to ^FF0000"+getd(.@min$)+"^000000 minutes and ^FF0000"+getd(.@sec$)+"^000000 seconds.";
@@ -1011,12 +1011,13 @@ function script Func_Are_Rew {
mes "You can exchange ^3131FF"+getarg(2)+" arena points with "+getarg(1)+" "+getitemname(getarg(0))+"^000000.";
mes "If you wish to cancel, please enter 0. If you don't, please enter how many ^3131FFtimes^000000 of arena points you wish to spend.";
next;
- input .@reward;
- if (.@reward == 0) {
+ input(.@reward);
+ if (.@reward <= 0) {
mes "[Givu]";
mes "You have canceled your request.";
close;
- } else if (.@reward > 1500) {
+ }
+ if (.@reward > 1500) {
mes "[Givu]";
mes "You have exceeded the maximum capacity.";
close;