修正出牌和选随从玩家灵活时间设置错误的bug

This commit is contained in:
zhl 2021-03-02 15:41:05 +08:00
parent fd6c7ea2b6
commit fb1923f421
2 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ export class DiscardCommand extends Command<CardGameState, { client: Client, car
if (elapsedTime >= 0) {
let maxTime = new GameEnv().maxDiscardTime * 1000
let count = elapsedTime - maxTime
let newCount = player.extraTime - Math.min(count, 0)
let newCount = player.extraTime - Math.max(count, 0)
player.extraTime = Math.max(newCount, 0)
}
for (let card of tmpCards) {

View File

@ -77,7 +77,7 @@ export class SelectPetCommand extends Command<CardGameState, {
let elapsedTime = this.room.stopSchedule(ClockNameConst.SELECT_PET)
if (elapsedTime >= 0) {
let count = elapsedTime - new GameEnv().playerActTime * 1000
let newCount = player.extraTime - Math.min(count, 0)
let newCount = player.extraTime - Math.max(count, 0)
player.extraTime = Math.max(newCount, 0)
}