mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
minor cleanups
This commit is contained in:
parent
ac6fe1a74b
commit
3032f45af2
@ -47,7 +47,7 @@ export class GoalAcceptorComponent extends Component {
|
||||
this.currentDeliveredItems = 0;
|
||||
}
|
||||
|
||||
getRequiredItemsPerSecond() {
|
||||
getRequiredSecondsPerItem() {
|
||||
return (
|
||||
globalConfig.goalAcceptorsPerProducer /
|
||||
(globalConfig.puzzleModeSpeed * globalConfig.beltSpeedItemsPerSecond)
|
||||
|
@ -28,9 +28,8 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (now - goalComp.lastDelivery.time > goalComp.getRequiredItemsPerSecond()) {
|
||||
goalComp.lastDelivery = null;
|
||||
goalComp.currentDeliveredItems = 0;
|
||||
if (now - goalComp.lastDelivery.time > goalComp.getRequiredSecondsPerItem()) {
|
||||
goalComp.clearItems();
|
||||
}
|
||||
|
||||
if (goalComp.currentDeliveredItems < globalConfig.goalAcceptorItemsRequired) {
|
||||
|
@ -573,13 +573,13 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
const item = payload.items[0].item;
|
||||
const now = this.root.time.now();
|
||||
|
||||
goalComp.currentDeliveredItems = Math.min(
|
||||
goalComp.currentDeliveredItems + 1,
|
||||
globalConfig.goalAcceptorItemsRequired
|
||||
);
|
||||
|
||||
if (goalComp.item && !item.equals(goalComp.item)) {
|
||||
goalComp.clearItems();
|
||||
} else {
|
||||
goalComp.currentDeliveredItems = Math.min(
|
||||
goalComp.currentDeliveredItems + 1,
|
||||
globalConfig.goalAcceptorItemsRequired
|
||||
);
|
||||
}
|
||||
|
||||
if (this.root.gameMode.getIsEditor()) {
|
||||
|
Loading…
Reference in New Issue
Block a user