Compare commits
3 Commits
24a35b5f2a
...
e3ebe46bf4
Author | SHA1 | Date | |
---|---|---|---|
|
e3ebe46bf4 | ||
|
e65e9e30f6 | ||
|
69c3a87da3 |
|
@ -268,6 +268,7 @@ export default class Ecs {
|
|||
markChange(entityId, components) {
|
||||
if (this.deferredChanges[entityId]) {
|
||||
this.deferredChanges[entityId].push(components);
|
||||
return;
|
||||
}
|
||||
// Deleted?
|
||||
if (false === components) {
|
||||
|
|
|
@ -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': {
|
||||
|
|
|
@ -13,9 +13,9 @@ if (projected?.length > 0) {
|
|||
bodies: [
|
||||
[
|
||||
{x: -8, y: -8},
|
||||
{x: 8, y: -8},
|
||||
{x: -8, y: 8},
|
||||
{x: 8, y: 8},
|
||||
{x: 7, y: -8},
|
||||
{x: -8, y: 7},
|
||||
{x: 7, y: 7},
|
||||
],
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user