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;
|
this.currentDeliveredItems = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getRequiredItemsPerSecond() {
|
getRequiredSecondsPerItem() {
|
||||||
return (
|
return (
|
||||||
globalConfig.goalAcceptorsPerProducer /
|
globalConfig.goalAcceptorsPerProducer /
|
||||||
(globalConfig.puzzleModeSpeed * globalConfig.beltSpeedItemsPerSecond)
|
(globalConfig.puzzleModeSpeed * globalConfig.beltSpeedItemsPerSecond)
|
||||||
|
@ -28,9 +28,8 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (now - goalComp.lastDelivery.time > goalComp.getRequiredItemsPerSecond()) {
|
if (now - goalComp.lastDelivery.time > goalComp.getRequiredSecondsPerItem()) {
|
||||||
goalComp.lastDelivery = null;
|
goalComp.clearItems();
|
||||||
goalComp.currentDeliveredItems = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goalComp.currentDeliveredItems < globalConfig.goalAcceptorItemsRequired) {
|
if (goalComp.currentDeliveredItems < globalConfig.goalAcceptorItemsRequired) {
|
||||||
|
@ -573,13 +573,13 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
|||||||
const item = payload.items[0].item;
|
const item = payload.items[0].item;
|
||||||
const now = this.root.time.now();
|
const now = this.root.time.now();
|
||||||
|
|
||||||
goalComp.currentDeliveredItems = Math.min(
|
|
||||||
goalComp.currentDeliveredItems + 1,
|
|
||||||
globalConfig.goalAcceptorItemsRequired
|
|
||||||
);
|
|
||||||
|
|
||||||
if (goalComp.item && !item.equals(goalComp.item)) {
|
if (goalComp.item && !item.equals(goalComp.item)) {
|
||||||
goalComp.clearItems();
|
goalComp.clearItems();
|
||||||
|
} else {
|
||||||
|
goalComp.currentDeliveredItems = Math.min(
|
||||||
|
goalComp.currentDeliveredItems + 1,
|
||||||
|
globalConfig.goalAcceptorItemsRequired
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.root.gameMode.getIsEditor()) {
|
if (this.root.gameMode.getIsEditor()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user