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