Fix wrong belt stats

This commit is contained in:
tobspr 2020-05-18 23:58:30 +02:00
parent a60d23da77
commit 14edac0f93
3 changed files with 15 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#ingame_HUD_EntityDebugger {
position: absolute;
@include S(right, 30px);
@include S(top, 250px);
@include S(top, 200px);
font-size: 14px;
line-height: 16px;
@ -37,7 +37,7 @@
.data {
@include S(width, 150px);
@include S(height, 50px);
@include S(height, 130px);
}
}
}

View File

@ -113,11 +113,11 @@ export class ItemEjectorSystem extends GameSystemWithFilter {
}
}
const undergroundBeltCmop = receiver.components.UndergroundBelt;
if (undergroundBeltCmop) {
const undergroundBeltComp = receiver.components.UndergroundBelt;
if (undergroundBeltComp) {
// Its an underground belt. yay.
if (
undergroundBeltCmop.tryAcceptExternalItem(
undergroundBeltComp.tryAcceptExternalItem(
item,
this.root.hubGoals.getUndergroundBeltBaseSpeed()
)

View File

@ -96,11 +96,15 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
/** @type {Array<{item: BaseItem, requiredSlot?: number, preferredSlot?: number}>} */
const outItems = [];
// Whether to track the production towards the analytics
let trackProduction = true;
// DO SOME MAGIC
switch (processorComp.type) {
// SPLITTER
case enumItemProcessorTypes.splitter: {
trackProduction = false;
const availableSlots = entity.components.ItemEjector.slots.length;
let nextSlot = processorComp.nextOutputSlot++ % availableSlots;
@ -311,6 +315,8 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
// HUB
case enumItemProcessorTypes.hub: {
trackProduction = false;
const hubComponent = entity.components.Hub;
assert(hubComponent, "Hub item processor has no hub component");
@ -327,8 +333,10 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
}
// Track produced items
for (let i = 0; i < outItems.length; ++i) {
this.root.signals.itemProduced.dispatch(outItems[i].item);
if (trackProduction) {
for (let i = 0; i < outItems.length; ++i) {
this.root.signals.itemProduced.dispatch(outItems[i].item);
}
}
processorComp.itemsToEject = outItems;