From 3809bf98e62a7e2a635f40abcb2b92c9a8dd559e Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 21 Jul 2024 19:24:22 -0500 Subject: [PATCH] refactor: immediate player destroy --- app/server/engine.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) {