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:
parent
f16d01365f
commit
f514e2735b
@ -40,6 +40,13 @@ export class GoalAcceptorComponent extends Component {
|
|||||||
this.displayPercentage = 0;
|
this.displayPercentage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clears items but doesn't instantly reset the progress bar
|
||||||
|
clearItems() {
|
||||||
|
this.lastDelivery = null;
|
||||||
|
|
||||||
|
this.currentDeliveredItems = 0;
|
||||||
|
}
|
||||||
|
|
||||||
getRequiredItemsPerSecond() {
|
getRequiredItemsPerSecond() {
|
||||||
return (
|
return (
|
||||||
globalConfig.goalAcceptorsPerProducer /
|
globalConfig.goalAcceptorsPerProducer /
|
||||||
|
@ -33,12 +33,6 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
|
|||||||
goalComp.currentDeliveredItems = 0;
|
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) {
|
if (goalComp.currentDeliveredItems < globalConfig.goalAcceptorItemsRequired) {
|
||||||
allAccepted = false;
|
allAccepted = false;
|
||||||
}
|
}
|
||||||
|
@ -578,12 +578,13 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
|||||||
globalConfig.goalAcceptorItemsRequired
|
globalConfig.goalAcceptorItemsRequired
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (goalComp.item && !item.equals(goalComp.item)) {
|
||||||
|
goalComp.clearItems();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.root.gameMode.getIsEditor()) {
|
if (this.root.gameMode.getIsEditor()) {
|
||||||
// while playing in editor, assign the item
|
// while playing in editor, assign the item
|
||||||
goalComp.item = payload.items[0].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 = {
|
goalComp.lastDelivery = {
|
||||||
|
Loading…
Reference in New Issue
Block a user