From 1fb0f26796315254b5e0133baaeed5384c02d80b Mon Sep 17 00:00:00 2001 From: nguen <104498646+gawgua@users.noreply.github.com> Date: Thu, 4 Aug 2022 12:43:16 +0700 Subject: [PATCH] remove unused variable in scene.ts (#40) --- src/commands/scene.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/commands/scene.ts b/src/commands/scene.ts index cfe29df..ed42395 100644 --- a/src/commands/scene.ts +++ b/src/commands/scene.ts @@ -1,13 +1,11 @@ import Logger from "../util/Logger"; import { ActorEntity } from "../game/entities/Actor"; import Interface, { Command } from "./Interface"; -import Database from "../db/Database"; import { GetCurSceneInfoScRsp } from "../data/proto/StarRail"; -import Session from "../server/kcp/Session"; import MazePlaneExcel from "../util/excel/MazePlaneExcel"; const c = new Logger("/scene", "blue"); -export default async function handle(command: Command, session: Session) { +export default async function handle(command: Command) { if (!Interface.target) { c.log("No target specified"); return; @@ -23,8 +21,8 @@ export default async function handle(command: Command, session: Session) { if (!planeID) return c.log("Usage: /scene "); Interface.target.player.db.posData = { - floorID: Number(planeID!.StartFloorID), - planeID: Number(planeID!.PlaneID), + floorID: planeID.StartFloorID, + planeID: planeID.PlaneID, pos: Interface.target.player.db.posData.pos }; await Interface.target.player.save() @@ -33,8 +31,8 @@ export default async function handle(command: Command, session: Session) { Interface.target.send(GetCurSceneInfoScRsp, { retcode: 0, scene: { - planeId: Number(planeID!.PlaneID), - floorId: Number(planeID!.StartFloorID), + planeId: planeID.PlaneID, + floorId: planeID.StartFloorID, entityList: [ curAvatarEntity ], @@ -48,4 +46,6 @@ export default async function handle(command: Command, session: Session) { Interface.target.player.scene.spawnEntity(curAvatarEntity, true); Interface.target.sync(); + + c.log(`Scene set to PlaneID: ${planeID.PlaneID}`); }