1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00
This commit is contained in:
Sense101 2021-04-16 09:36:13 +01:00
parent ea375e92e3
commit 64546d6554
2 changed files with 7 additions and 10 deletions

View File

@ -24,12 +24,14 @@ export class BeltReaderSystem extends GameSystemWithFilter {
} }
pinsComp.slots[1].value = readerComp.lastItem; pinsComp.slots[1].value = readerComp.lastItem;
if( (readerComp.lastItemTimes[readerComp.lastItemTimes.length - 1] || 0) > if (
minimumTimeForThroughput) { (readerComp.lastItemTimes[readerComp.lastItemTimes.length - 1] || 0) >
minimumTimeForThroughput
) {
pinsComp.slots[0].value = BOOL_TRUE_SINGLETON; pinsComp.slots[0].value = BOOL_TRUE_SINGLETON;
} else { } else {
pinsComp.slots[0].value = BOOL_FALSE_SINGLETON; pinsComp.slots[0].value = BOOL_FALSE_SINGLETON;
if(entity.components.ItemEjector.canEjectOnSlot(0)) { if (entity.components.ItemEjector.canEjectOnSlot(0)) {
readerComp.lastItem = null; readerComp.lastItem = null;
} }
} }
@ -50,15 +52,10 @@ export class BeltReaderSystem extends GameSystemWithFilter {
} }
throughput = 1 / (averageSpacing / averageSpacingNum); throughput = 1 / (averageSpacing / averageSpacingNum);
const decimal = throughput - Math.floor(throughput);
if(decimal > 0.8)
{
throughput = Math.round(throughput);
}
} }
readerComp.lastThroughput = Math.min(globalConfig.beltSpeedItemsPerSecond * 23.9, throughput); readerComp.lastThroughput = Math.min(globalConfig.beltSpeedItemsPerSecond * 23.9, throughput);
} }
} }
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"lib": ["ES2018","WebWorker"] "lib": ["ES2018", "WebWorker"]
}, },
"exclude": [], "exclude": [],
"extends": "../tsconfig", "extends": "../tsconfig",