fix getting stuck after flexible moving and logging out
This commit is contained in:
@@ -52,6 +52,8 @@ export class FlexibleInstanceMove {
|
||||
}
|
||||
|
||||
onFlexibleMovementTick() {
|
||||
if (!this.player?.isValid)
|
||||
this.finish();
|
||||
const playerMovement = new PlayerMovement(this.player);
|
||||
const instanceVelocity = this.calculateInstanceMovement(playerMovement);
|
||||
this.move(instanceVelocity);
|
||||
@@ -105,7 +107,8 @@ export class FlexibleInstanceMove {
|
||||
this.instance.enable();
|
||||
this.instance.flexMovingPlayerId = void 0;
|
||||
this.allowPlayerMovement(true);
|
||||
const builder = Builders.get(this.player.id);
|
||||
const builder = Builders.get(this.player?.id);
|
||||
if (builder)
|
||||
builder.flexibleInstanceMovement = void 0;
|
||||
world.beforeEvents.itemUse.unsubscribe(this.onPlayerUseItemBound);
|
||||
world.beforeEvents.playerLeave.unsubscribe(this.onPlayerLeaveBound);
|
||||
|
||||
Reference in New Issue
Block a user