Skip to content

Commit

Permalink
fix safe player spawning
Browse files Browse the repository at this point in the history
  • Loading branch information
Tombez committed Sep 13, 2021
1 parent 9fdb886 commit 34e0056
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ class Server {
spawnVirus() {
var virus = new Entity.Virus(this, null, this.randomPos(), this.config.virusMinSize);
this.safeSpawn(virus);

}
spawnCells(virusCount, foodCount) {
for (var i = 0; i < foodCount; i++) {
Expand Down Expand Up @@ -720,13 +720,7 @@ class Server {
}
// Spawn player safely (do not check minions)
var cell = new Entity.PlayerCell(this, player, pos, size);
if (!player.isMi) {
this.addNode(cell);
}
else {
this.safeSpawn(cell);
}

player.isMi ? this.addNode(cell) : this.safeSpawn(cell);
// Set initial mouse coords
player.mouse.assign(pos);
}
Expand Down

0 comments on commit 34e0056

Please sign in to comment.