bugfix again
This commit is contained in:
parent
635c5d577c
commit
2f5c4db818
3 changed files with 10 additions and 4 deletions
|
@ -126,8 +126,6 @@ class Game extends GameBasic {
|
|||
this.ws.close();
|
||||
this.ws = new WebSocket(origin);
|
||||
this.ws.addEventListener('message', function (e) { that.recv(e) });
|
||||
this.player = new Player(false, true);
|
||||
this.entities.push(this.player);
|
||||
} else if (player.isMenu) {
|
||||
player.r = Math.floor(Math.abs(player.rot / 1.2) % emojis.length);
|
||||
player.isMenu = false;
|
||||
|
@ -180,7 +178,10 @@ class Game extends GameBasic {
|
|||
|
||||
let matchingPlayer = entList.filter(x => x.you == you)
|
||||
|
||||
if (matchingPlayer.length == 0) matchingPlayer = entList.filter(x => x.type == 'Player');
|
||||
|
||||
if (matchingPlayer.length == 0) {
|
||||
matchingPlayer = entList.filter(x => x.isYou);
|
||||
}
|
||||
|
||||
this.player = Object.assign(this.player || new Player(false, false), matchingPlayer[0]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue