1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Fix items being stuck on belts

This commit is contained in:
tobspr
2020-06-27 12:50:35 +02:00
parent fa3d516913
commit 84417b60a5
2 changed files with 27 additions and 1 deletions

View File

@@ -165,7 +165,17 @@ export class BeltPath extends BasicSerializableObject {
this.ejectorSlot = this.ejectorComp.slots[0];
for (let i = 0; i < this.entityPath.length; ++i) {
this.entityPath[i].components.ItemEjector.enabled = i === this.entityPath.length - 1;
const ejectorComp = this.entityPath[i].components.ItemEjector;
const isLast = i === this.entityPath.length - 1;
ejectorComp.enabled = isLast;
// Clear all slots of non-end entities
if (!isLast) {
for (let k = 0; k < ejectorComp.slots.length; ++k) {
ejectorComp.slots[k].item = null;
ejectorComp.slots[k].progress = 0.0;
}
}
}
}