From 5c6ae768b857e27178688cc62b0a22c38cdf31a7 Mon Sep 17 00:00:00 2001 From: tamilpp25 Date: Sat, 6 Aug 2022 15:20:15 +0530 Subject: [PATCH] prevent saving some scenes to db as they cause invalid scene bug during login --- src/commands/scene.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/commands/scene.ts b/src/commands/scene.ts index 1f874e9..1010382 100644 --- a/src/commands/scene.ts +++ b/src/commands/scene.ts @@ -37,10 +37,13 @@ export default async function handle(command: Command) { const lineup = await Interface.target.player.getLineup(); const curAvatarEntity = new ActorEntity(Interface.target.player.scene, lineup.leaderSlot, posData.pos); + const allowedScenes = ['Train','Town','Maze'] // Update scene information on player. - Interface.target.player.db.posData.planeID = planeData.PlaneID; - Interface.target.player.db.posData.floorID = floorId - await Interface.target.player.save() + if(allowedScenes.includes(planeData.PlaneType)){ + Interface.target.player.db.posData.planeID = planeData.PlaneID; + Interface.target.player.db.posData.floorID = floorId + await Interface.target.player.save() + } //change scene for player Interface.target.send(GetCurSceneInfoScRsp, {