mirror of
https://github.com/jie65535/mirai-console-jhr-plugin.git
synced 2025-06-02 17:39:16 +08:00
修复 获胜逻辑顺序错误问题
This commit is contained in:
parent
8c448602e1
commit
462fb4d3ba
@ -136,10 +136,8 @@ object JHorseRacing : KotlinPlugin(
|
||||
delay(Random.nextLong(5000, 7000))
|
||||
|
||||
// 所有马前进
|
||||
for ((i, horse) in rank.horses.withIndex()) {
|
||||
if (++horse.position >= lapLength) {
|
||||
winners.add(i + 1)
|
||||
}
|
||||
for (horse in rank.horses) {
|
||||
++horse.position
|
||||
}
|
||||
|
||||
// 比赛事件触发
|
||||
@ -154,6 +152,14 @@ object JHorseRacing : KotlinPlugin(
|
||||
JHRPluginConfig.badEvents[Random.nextInt(JHRPluginConfig.badEvents.size)]
|
||||
}
|
||||
|
||||
|
||||
// 计算获胜者
|
||||
for ((i, horse) in rank.horses.withIndex()) {
|
||||
if (horse.position >= lapLength) {
|
||||
winners.add(i + 1)
|
||||
}
|
||||
}
|
||||
|
||||
val number = (eventHorseIndex + 1).toString()
|
||||
subject.sendMessage(eventMsg.replace("?", number))
|
||||
delay(Random.nextLong(100, 200))
|
||||
|
Loading…
Reference in New Issue
Block a user