added companion compatibility with phaser 3.54.0
This commit is contained in:
parent
32784d6775
commit
8d4e0c3e88
@ -23,5 +23,7 @@ export const lazyLoadCompanionResource = (loader: LoaderPlugin, name: string): P
|
|||||||
|
|
||||||
loader.spritesheet(resource.name, resource.img, { frameWidth: 32, frameHeight: 32, endFrame: 12 });
|
loader.spritesheet(resource.name, resource.img, { frameWidth: 32, frameHeight: 32, endFrame: 12 });
|
||||||
loader.once(`filecomplete-spritesheet-${resource.name}`, () => resolve(resource.name));
|
loader.once(`filecomplete-spritesheet-${resource.name}`, () => resolve(resource.name));
|
||||||
|
|
||||||
|
loader.start(); // It's only automatically started during the Scene preload.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -227,9 +227,5 @@ export abstract class Character extends Container {
|
|||||||
}
|
}
|
||||||
super.destroy();
|
super.destroy();
|
||||||
this.playerName.destroy();
|
this.playerName.destroy();
|
||||||
|
|
||||||
if (this.companion) {
|
|
||||||
this.companion.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -854,6 +854,11 @@ ${escapedMessage}
|
|||||||
private removeAllRemotePlayers(): void {
|
private removeAllRemotePlayers(): void {
|
||||||
this.MapPlayersByKey.forEach((player: RemotePlayer) => {
|
this.MapPlayersByKey.forEach((player: RemotePlayer) => {
|
||||||
player.destroy();
|
player.destroy();
|
||||||
|
|
||||||
|
if (player.companion) {
|
||||||
|
player.companion.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
this.MapPlayers.remove(player);
|
this.MapPlayers.remove(player);
|
||||||
});
|
});
|
||||||
this.MapPlayersByKey = new Map<number, RemotePlayer>();
|
this.MapPlayersByKey = new Map<number, RemotePlayer>();
|
||||||
@ -1243,6 +1248,11 @@ ${escapedMessage}
|
|||||||
console.error('Cannot find user with id ', userId);
|
console.error('Cannot find user with id ', userId);
|
||||||
} else {
|
} else {
|
||||||
player.destroy();
|
player.destroy();
|
||||||
|
|
||||||
|
if (player.companion) {
|
||||||
|
player.companion.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
this.MapPlayers.remove(player);
|
this.MapPlayers.remove(player);
|
||||||
}
|
}
|
||||||
this.MapPlayersByKey.delete(userId);
|
this.MapPlayersByKey.delete(userId);
|
||||||
|
Loading…
Reference in New Issue
Block a user