From e445878ed82fd9945c0a5cd0b055f0109a6051c3 Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Tue, 7 Apr 2026 20:26:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=B8=AD=E6=A8=A1=E6=8B=9F=E8=B5=9B=E9=A9=AC=E5=A5=96=E5=8A=B1?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原检查条件错误地减去了1,导致在赛马数量为0时出现负值。 现在直接比较奖励调用次数与赛马数量是否相等。 --- danding_bot/plugins/group_horse_racing/test_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/danding_bot/plugins/group_horse_racing/test_commands.py b/danding_bot/plugins/group_horse_racing/test_commands.py index 579d1cd..7d22724 100644 --- a/danding_bot/plugins/group_horse_racing/test_commands.py +++ b/danding_bot/plugins/group_horse_racing/test_commands.py @@ -341,7 +341,7 @@ async def handle_test_simulate_race(bot: Bot, event: Event): return participant_calls = [c for c in fake_points_service.calls if c[0] == "reward_participant"] - if len(participant_calls) != max(0, len(room.horses) - 1): + if len(participant_calls) != len(room.horses): await test_simulate_race_cmd.send("完全模拟失败:参赛奖励次数不匹配(内存记录)") return