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:
parent
cd72da5023
commit
cb4ccdbb79
@ -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;
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
|
||||
input.extraProgress
|
||||
)
|
||||
) {
|
||||
acceptorComp.completedInputs = [];
|
||||
acceptorComp.completedInputs.splice(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user