Skip to content

Commit

Permalink
修复机器人会让玩家进入选卡CD的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Jan 25, 2024
1 parent 588f0e8 commit 415e0dc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/kotlin/message/UpdateSpellCs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 415e0dc

Please sign in to comment.