1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-13 02:01:51 +00:00

Prevent filter and tunnel from deleting extra acceptor items

This commit is contained in:
Sense101 2022-01-25 18:30:14 +00:00
parent cd72da5023
commit cb4ccdbb79
2 changed files with 4 additions and 5 deletions

View File

@ -4,8 +4,6 @@ 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]);
@ -21,7 +19,8 @@ export class FilterSystem extends GameSystemWithFilter {
// Take items from acceptor
const input = acceptorComp.completedInputs[0];
if (input && this.tryAcceptItem(entity, input.item, input.extraProgress)) {
acceptorComp.completedInputs = [];
// only remove one
acceptorComp.completedInputs.splice(0);
}
// Output to ejector
@ -64,7 +63,7 @@ export class FilterSystem extends GameSystemWithFilter {
listToCheck = filterComp.pendingItemsToReject;
}
if (listToCheck.length >= MAX_ITEMS_IN_QUEUE) {
if (!listToCheck.length) {
// Busy
return false;
}

View File

@ -323,7 +323,7 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
input.extraProgress
)
) {
acceptorComp.completedInputs = [];
acceptorComp.completedInputs.splice(0);
}
}
}