(fix #914) mcfish bug:out of range (#923)

修复 mcfish 数组越界问题
This commit is contained in:
vatebur 2024-06-11 20:52:37 +08:00 committed by GitHub
parent 3b3b17aa33
commit 81e255eb3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -431,7 +431,7 @@ func init() {
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[0]请输入正确的序号\n", list)) ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[0]请输入正确的序号\n", list))
continue continue
} }
if first > max || second > max || third > max { if first >= max || second >= max || third >= max {
ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[", max, "]请输入正确的序号\n", list)) ctx.SendChain(message.At(ctx.Event.UserID), message.Text("[", max, "]请输入正确的序号\n", list))
continue continue
} }