Fix belt rendering bug

pull/302/head
tobspr 4 years ago
parent 182b62d604
commit 7ca425c8f3

@ -256,7 +256,7 @@ export class BeltSystem extends GameSystemWithFilter {
maxProgress = Math.min(2, 1 - globalConfig.itemSpacingOnBelts + spacingOnBelt);
// Useful check, but hurts performance
// assert(maxProgress >= 0.0, "max progress < 0 (I)");
// assert(maxProgress >= 0.0, "max progress < 0 (I) (" + maxProgress + ")");
}
}
@ -280,12 +280,16 @@ export class BeltSystem extends GameSystemWithFilter {
const progressAndItem = items[itemIndex];
progressAndItem[0] = Math.min(maxProgress, progressAndItem[0] + speedMultiplier * beltSpeed);
assert(progressAndItem[0] >= 0, "Bad progress: " + progressAndItem[0]);
if (progressAndItem[0] >= 1.0) {
if (beltComp.followUpCache) {
const followUpBelt = beltComp.followUpCache.components.Belt;
if (followUpBelt.canAcceptItem()) {
followUpBelt.takeItem(progressAndItem[1], progressAndItem[0] - takeoverOffset);
followUpBelt.takeItem(
progressAndItem[1],
Math_max(0, progressAndItem[0] - takeoverOffset)
);
items.splice(itemIndex, 1);
} else {
// Well, we couldn't really take it to a follow up belt, keep it at

@ -215,7 +215,7 @@ export const allApplicationSettings = [
}),
new EnumSetting("refreshRate", {
options: ["60", "100", "144", "165", "250", "500"],
options: ["60", "100", "144", "165", "250", G_IS_DEV ? "10" : "500"],
valueGetter: rate => rate,
textGetter: rate => rate + " Hz",
category: categoryGame,

Loading…
Cancel
Save