summaryrefslogtreecommitdiff
path: root/npc/other/hugel_bingo.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/hugel_bingo.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/hugel_bingo.txt')
-rw-r--r--npc/other/hugel_bingo.txt31
1 files changed, 18 insertions, 13 deletions
diff --git a/npc/other/hugel_bingo.txt b/npc/other/hugel_bingo.txt
index 9c7b87ee4..bf64d7105 100644
--- a/npc/other/hugel_bingo.txt
+++ b/npc/other/hugel_bingo.txt
@@ -481,7 +481,7 @@ OnTouch:
mes "Quickly, say ''^FF0000Bingo^000000!''";
mes "Remember, you'll only";
mes "have one chance to say it!";
- input @bingoyell$;
+ input(@bingoyell$);
if (@bingoyell$ == "Bingo") {
if ($@hu_bingoa == 5) {
$@hu_bingoa = 6;
@@ -500,14 +500,13 @@ OnTouch:
mes "next time, alright?";
close;
}
- } else {
- next;
- mes "I'm sorry, but you";
- mes "said it wrong. Next time,";
- mes "make sure that you yell";
- mes "out the word, ''^FF0000Bingo^000000,'' okay?";
- close;
}
+ next;
+ mes "I'm sorry, but you";
+ mes "said it wrong. Next time,";
+ mes "make sure that you yell";
+ mes "out the word, ''^FF0000Bingo^000000,'' okay?";
+ close;
}
close;
}
@@ -860,11 +859,17 @@ function script Func_Bingo {
}
}
next;
- input .@bingoinput;
- if(.@bingoinput < 1 || .@bingoinput > 25) { @bingo_case = .@i; return 0; }
- if(.@i > 1) {
- for(.@j = .@i; .@j > 0; --.@j) {
- if(.@bingoinput == @bingoplate[.@j -1]) { @bingo_case = .@i; return 0; }
+ input(.@bingoinput);
+ if (.@bingoinput < 1 || .@bingoinput > 25) {
+ @bingo_case = .@i;
+ return 0;
+ }
+ if (.@i > 1) {
+ for (.@j = .@i; .@j > 0; --.@j) {
+ if (.@bingoinput == @bingoplate[.@j -1]) {
+ @bingo_case = .@i;
+ return 0;
+ }
}
}
setarray @bingoplate[.@i],.@bingoinput;