Fixing start position on disconnect
This commit is contained in:
parent
928e486de5
commit
43e4489d4d
@ -160,6 +160,11 @@ export class GameScene extends Phaser.Scene {
|
||||
throw new Error('Your map MUST contain a layer of type "objectgroup" whose name is "floorLayer" that represents the layer characters are drawn at.');
|
||||
}
|
||||
|
||||
// If there is an init position passed
|
||||
if (this.initPosition !== null) {
|
||||
this.startX = this.initPosition.x;
|
||||
this.startY = this.initPosition.y;
|
||||
} else {
|
||||
// Now, let's find the start layer
|
||||
if (this.startLayerName) {
|
||||
for (let layer of this.mapFile.layers) {
|
||||
@ -180,6 +185,7 @@ export class GameScene extends Phaser.Scene {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Still no start position? Something is wrong with the map, we need a "start" layer.
|
||||
if (this.startX === undefined) {
|
||||
console.warn('This map is missing a layer named "start" that contains the available default start positions.');
|
||||
|
Loading…
Reference in New Issue
Block a user