From 415e0dc009afff6eb86aa7752d805e9ec14513c4 Mon Sep 17 00:00:00 2001 From: CuteReimu <415551921@qq.com> Date: Thu, 25 Jan 2024 15:36:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E4=BC=9A=E8=AE=A9=E7=8E=A9=E5=AE=B6=E8=BF=9B=E5=85=A5=E9=80=89?= =?UTF-8?q?=E5=8D=A1CD=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/message/UpdateSpellCs.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/message/UpdateSpellCs.kt b/src/main/kotlin/message/UpdateSpellCs.kt index c0501cb..38cf0b5 100644 --- a/src/main/kotlin/message/UpdateSpellCs.kt +++ b/src/main/kotlin/message/UpdateSpellCs.kt @@ -28,13 +28,10 @@ class UpdateSpellCs( throw HandlerException("找不到${Store.robotPlayer.name}") } val now = System.currentTimeMillis() - val newStatus = - if (controlRobot) - room.type.handleUpdateSpell(room, Store.robotPlayer.token, idx, spellStatus, now, isReset) - else - room.type.handleUpdateSpell(room, token, idx, spellStatus, now, isReset) + val playerToken = if (controlRobot) Store.robotPlayer.token else token + val newStatus = room.type.handleUpdateSpell(room, playerToken, idx, spellStatus, now, isReset) room.spellStatus!![idx] = newStatus - val playerIndex = room.players.indexOf(token) + val playerIndex = room.players.indexOf(playerToken) if (playerIndex >= 0 && spellStatus.isGetStatus()) room.lastGetTime[playerIndex] = now - room.totalPauseMs - room.startMs Store.putRoom(room)