mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-13 02:01:51 +00:00
Fix filter and item acceptor drawing
This commit is contained in:
parent
212c880e75
commit
b5eb759b69
@ -4,6 +4,8 @@ import { Entity } from "../entity";
|
||||
import { GameSystemWithFilter } from "../game_system_with_filter";
|
||||
import { BOOL_TRUE_SINGLETON } from "../items/boolean_item";
|
||||
|
||||
const MAX_ITEMS_IN_QUEUE = 2;
|
||||
|
||||
export class FilterSystem extends GameSystemWithFilter {
|
||||
constructor(root) {
|
||||
super(root, [FilterComponent]);
|
||||
@ -62,7 +64,7 @@ export class FilterSystem extends GameSystemWithFilter {
|
||||
listToCheck = filterComp.pendingItemsToReject;
|
||||
}
|
||||
|
||||
if (!listToCheck.length) {
|
||||
if (listToCheck.length >= MAX_ITEMS_IN_QUEUE) {
|
||||
// Busy
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ export class ItemAcceptorSystem extends GameSystemWithFilter {
|
||||
|
||||
if (!chunk.tileSpaceRectangle.containsPoint(realSlotPos.x, realSlotPos.y)) {
|
||||
// Not within this chunk
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
const fadeOutDirection =
|
||||
|
||||
@ -285,11 +285,11 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
// only remove one item from each slot - we don't want to delete extra items!
|
||||
let usedSlots = [];
|
||||
for (let i = 0; i < acceptorComp.completedInputs.length; i++) {
|
||||
const slot = acceptorComp.completedInputs[i].slotIndex;
|
||||
const index = acceptorComp.completedInputs[i].slotIndex;
|
||||
|
||||
if (!usedSlots.includes(slot)) {
|
||||
usedSlots.push(slot);
|
||||
acceptorComp.completedInputs.splice(i);
|
||||
if (!usedSlots.includes(index)) {
|
||||
usedSlots.push(index);
|
||||
acceptorComp.completedInputs.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user