fix getting stuck after flexible moving and logging out

This commit is contained in:
ForestOfLight
2026-02-11 15:03:55 -08:00
Unverified
parent 162ef58406
commit d61a121307
@@ -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,8 +107,9 @@ 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);
builder.flexibleInstanceMovement = void 0; if (builder)
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);
this.sendFeedback({ translate: 'construct.instance.flexibleMove.finish', with: [ this.sendFeedback({ translate: 'construct.instance.flexibleMove.finish', with: [