From b10cbb906a7e155d33cfc165dfe407d8d4936d5a Mon Sep 17 00:00:00 2001 From: zhl Date: Thu, 24 Dec 2020 13:56:05 +0800 Subject: [PATCH] =?UTF-8?q?select=5Fpet=5Fc2s=E5=A2=9E=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5oldpos,=20=E7=94=A8=E4=BA=8E=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E9=9A=8F=E4=BB=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rooms/GeneralRoom.ts | 2 +- src/rooms/commands/SelectPetCommand.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rooms/GeneralRoom.ts b/src/rooms/GeneralRoom.ts index 724dfae..9b00c72 100644 --- a/src/rooms/GeneralRoom.ts +++ b/src/rooms/GeneralRoom.ts @@ -68,7 +68,7 @@ export class GeneralRoom extends Room { this.onMessage("select_pet_c2s", (client, message) => { msgLog('select_pet from ', client.sessionId, message); - this.dispatcher.dispatch(new SelectPetCommand(), {client, cardId: message.card, playerId: message.player, pos: message.pos, effCards: message.effCards }); + this.dispatcher.dispatch(new SelectPetCommand(), {client, cardId: message.card, playerId: message.player, pos: message.pos, effCards: message.effCards, oldpos: message.oldpos }); }); this.onMessage("select_hero_c2s", (client, message) => { diff --git a/src/rooms/commands/SelectPetCommand.ts b/src/rooms/commands/SelectPetCommand.ts index 802874a..364ca57 100644 --- a/src/rooms/commands/SelectPetCommand.ts +++ b/src/rooms/commands/SelectPetCommand.ts @@ -12,9 +12,10 @@ export class SelectPetCommand extends Command { - async execute({client, cardId, playerId, pos, effCards} = this.payload) { + async execute({client, cardId, playerId, pos, effCards, oldpos} = this.payload) { let sessionId = client.sessionId; let player = this.state.players.get(sessionId); let ap = 0; @@ -72,7 +73,7 @@ export class SelectPetCommand extends Command