refactor: immediate player destroy
This commit is contained in:
parent
4278ee7675
commit
3809bf98e6
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user