When sharing user position, only position is sent now!

This commit is contained in:
David Négrier 2020-05-15 23:40:05 +02:00
parent cdfa9acf01
commit 4d1c3517ec
5 changed files with 40 additions and 55 deletions

View file

@ -81,12 +81,12 @@ export class Player extends PlayableCaracter implements CurrentGamerInterface, G
}
if (x !== 0 || y !== 0) {
this.move(x, y);
this.emit(hasMovedEventName, {direction, x: this.x, y: this.y, character: this.PlayerTexture});
this.emit(hasMovedEventName, {direction, x: this.x, y: this.y});
} else {
if (this.previousMove !== PlayerAnimationNames.None) {
direction = PlayerAnimationNames.None;
this.stop();
this.emit(hasMovedEventName, {direction, x: this.x, y: this.y, character: this.PlayerTexture});
this.emit(hasMovedEventName, {direction, x: this.x, y: this.y});
}
}