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