Merge branch 'master' of github.com:thecodingmachine/workadventure into develop
This commit is contained in:
@@ -82,7 +82,7 @@ export class Room {
|
||||
const currentRoom = new Room(baseUrl);
|
||||
let instance: string = "global";
|
||||
if (currentRoom.isPublic) {
|
||||
instance = currentRoom.instance as string;
|
||||
instance = currentRoom.getInstance();
|
||||
}
|
||||
|
||||
baseUrl.pathname = "/_/" + instance + "/" + absoluteExitSceneUrl.host + absoluteExitSceneUrl.pathname;
|
||||
|
||||
@@ -87,9 +87,11 @@ import GameObject = Phaser.GameObjects.GameObject;
|
||||
import DOMElement = Phaser.GameObjects.DOMElement;
|
||||
import Tileset = Phaser.Tilemaps.Tileset;
|
||||
import SpriteSheetFile = Phaser.Loader.FileTypes.SpriteSheetFile;
|
||||
import { deepCopy } from "deep-copy-ts";
|
||||
import FILE_LOAD_ERROR = Phaser.Loader.Events.FILE_LOAD_ERROR;
|
||||
import { MapStore } from "../../Stores/Utils/MapStore";
|
||||
import { SetPlayerDetailsMessage } from "../../Messages/generated/messages_pb";
|
||||
|
||||
export interface GameSceneInitInterface {
|
||||
initPosition: PointInterface | null;
|
||||
reconnecting: boolean;
|
||||
@@ -342,7 +344,10 @@ export class GameScene extends DirtyScene {
|
||||
private async onMapLoad(data: any): Promise<void> {
|
||||
// Triggered when the map is loaded
|
||||
// Load tiles attached to the map recursively
|
||||
this.mapFile = data.data;
|
||||
|
||||
// The map file can be modified by the scripting API and we don't want to tamper the Phaser cache (in case we come back on the map after visiting other maps)
|
||||
// So we are doing a deep copy
|
||||
this.mapFile = deepCopy(data.data);
|
||||
const url = this.MapUrlFile.substr(0, this.MapUrlFile.lastIndexOf("/"));
|
||||
this.mapFile.tilesets.forEach((tileset) => {
|
||||
if (typeof tileset.name === "undefined" || typeof tileset.image === "undefined") {
|
||||
|
||||
Reference in New Issue
Block a user