diff --git a/app/server/engine.js b/app/server/engine.js index 613e779..8184b32 100644 --- a/app/server/engine.js +++ b/app/server/engine.js @@ -88,7 +88,7 @@ export default class Engine { ...updates, }; // remove from old ECS - this.destroy(entity.id); + this.destroyImmediately(entity.id); // load if necessary if (!engine.ecses[path]) { await engine.loadEcs(path); @@ -230,7 +230,7 @@ export default class Engine { const {entity, id} = connectedPlayer; const ecs = this.ecses[entity.Ecs.path]; await this.savePlayer(id, entity); - ecs.destroy(entity.id); + ecs.destroyImmediately(entity.id); this.connectedPlayers.delete(connection); this.incomingActions.delete(connection); } @@ -322,7 +322,6 @@ export default class Engine { stop() { clearTimeout(this.handle); this.handle = undefined; - this.tick(0); } tick(elapsed) {