1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

fixed a minor bug

This commit is contained in:
Sense101 2021-06-23 20:58:54 +01:00
parent f16d01365f
commit f514e2735b
3 changed files with 11 additions and 9 deletions

View File

@ -40,6 +40,13 @@ export class GoalAcceptorComponent extends Component {
this.displayPercentage = 0;
}
// clears items but doesn't instantly reset the progress bar
clearItems() {
this.lastDelivery = null;
this.currentDeliveredItems = 0;
}
getRequiredItemsPerSecond() {
return (
globalConfig.goalAcceptorsPerProducer /

View File

@ -33,12 +33,6 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
goalComp.currentDeliveredItems = 0;
}
//// filter the ones which are no longer active, or which are not the same
//goalComp.deliveryHistory = goalComp.deliveryHistory.filter(
// d =>
// now - d.time < globalConfig.goalAcceptorMinimumDurationSeconds && d.item === goalComp.item
//);
if (goalComp.currentDeliveredItems < globalConfig.goalAcceptorItemsRequired) {
allAccepted = false;
}

View File

@ -578,12 +578,13 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
globalConfig.goalAcceptorItemsRequired
);
if (goalComp.item && !item.equals(goalComp.item)) {
goalComp.clearItems();
}
if (this.root.gameMode.getIsEditor()) {
// while playing in editor, assign the item
goalComp.item = payload.items[0].item;
} else if (!item.equals(goalComp.item)) {
// if the inputted item isn't the same, clear the acceptor
goalComp.clear();
}
goalComp.lastDelivery = {