diff --git a/app/engine.js b/app/engine.js index b875aab..3bf4058 100644 --- a/app/engine.js +++ b/app/engine.js @@ -51,15 +51,19 @@ export default class Engine { } } this.server.addPacketListener('Action', (connection, payload) => { - this.incomingActions.push([this.connectedPlayers.get(connection).entity, payload]); + this.incomingActions.push([connection, payload]); }); } acceptActions() { for (const [ - entity, + connection, payload, ] of this.incomingActions) { + if (!this.connectedPlayers.get(connection)) { + continue; + } + const {entity} = this.connectedPlayers.get(connection); const {Controlled, Ecs, Interacts, Inventory, Wielder} = entity; switch (payload.type) { case 'changeSlot': {