From f4fc33be7b3a91534dd729438d6e68b85a29a158 Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 23 Dec 2020 13:50:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=9A=8F=E4=BB=8E=E6=97=B6,?= =?UTF-8?q?=20=E6=97=A0=E6=9C=89=E6=95=88=E6=93=8D=E4=BD=9C=E6=97=B6,=20?= =?UTF-8?q?=E8=BD=AE=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/robot/Robot.ts | 4 +++- src/robot/RobotClient.ts | 4 +++- src/utils/assistant.util.ts | 5 +---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/robot/Robot.ts b/src/robot/Robot.ts index a33f4ad..262b7be 100644 --- a/src/robot/Robot.ts +++ b/src/robot/Robot.ts @@ -223,7 +223,9 @@ export class Robot { @wait('playerActTime') private async selectPet() { let data = await assistantUtil.selectPet(this.player, this.room.state); - this.reply('select_pet_c2s', data); + if (data) { + this.reply('select_pet_c2s', data); + } } diff --git a/src/robot/RobotClient.ts b/src/robot/RobotClient.ts index 183931e..b268ab3 100644 --- a/src/robot/RobotClient.ts +++ b/src/robot/RobotClient.ts @@ -230,7 +230,9 @@ export class RobotClient implements Client { @wait('playerActTime') private async selectPet() { let data = await assistantUtil.selectPet(this.selfPlayer, this.svrstate); - this.reply('select_pet_c2s', data) + if (data) { + this.reply('select_pet_c2s', data); + } } } diff --git a/src/utils/assistant.util.ts b/src/utils/assistant.util.ts index 3e900c2..f7ebec9 100644 --- a/src/utils/assistant.util.ts +++ b/src/utils/assistant.util.ts @@ -170,10 +170,7 @@ let assistantUtil = { result = spellCards.randomOne(); } if (!result) { - return { - card: result.id, - errcode: 1, - }; + return null; } let targetType: SkillTargetType = CfgMan.getTargetByCard(result.effect); let targetPlayer;