mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fix belt rendering bug
This commit is contained in:
parent
182b62d604
commit
7ca425c8f3
@ -256,7 +256,7 @@ export class BeltSystem extends GameSystemWithFilter {
|
|||||||
maxProgress = Math.min(2, 1 - globalConfig.itemSpacingOnBelts + spacingOnBelt);
|
maxProgress = Math.min(2, 1 - globalConfig.itemSpacingOnBelts + spacingOnBelt);
|
||||||
|
|
||||||
// Useful check, but hurts performance
|
// 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];
|
const progressAndItem = items[itemIndex];
|
||||||
|
|
||||||
progressAndItem[0] = Math.min(maxProgress, progressAndItem[0] + speedMultiplier * beltSpeed);
|
progressAndItem[0] = Math.min(maxProgress, progressAndItem[0] + speedMultiplier * beltSpeed);
|
||||||
|
assert(progressAndItem[0] >= 0, "Bad progress: " + progressAndItem[0]);
|
||||||
|
|
||||||
if (progressAndItem[0] >= 1.0) {
|
if (progressAndItem[0] >= 1.0) {
|
||||||
if (beltComp.followUpCache) {
|
if (beltComp.followUpCache) {
|
||||||
const followUpBelt = beltComp.followUpCache.components.Belt;
|
const followUpBelt = beltComp.followUpCache.components.Belt;
|
||||||
if (followUpBelt.canAcceptItem()) {
|
if (followUpBelt.canAcceptItem()) {
|
||||||
followUpBelt.takeItem(progressAndItem[1], progressAndItem[0] - takeoverOffset);
|
followUpBelt.takeItem(
|
||||||
|
progressAndItem[1],
|
||||||
|
Math_max(0, progressAndItem[0] - takeoverOffset)
|
||||||
|
);
|
||||||
items.splice(itemIndex, 1);
|
items.splice(itemIndex, 1);
|
||||||
} else {
|
} else {
|
||||||
// Well, we couldn't really take it to a follow up belt, keep it at
|
// 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", {
|
new EnumSetting("refreshRate", {
|
||||||
options: ["60", "100", "144", "165", "250", "500"],
|
options: ["60", "100", "144", "165", "250", G_IS_DEV ? "10" : "500"],
|
||||||
valueGetter: rate => rate,
|
valueGetter: rate => rate,
|
||||||
textGetter: rate => rate + " Hz",
|
textGetter: rate => rate + " Hz",
|
||||||
category: categoryGame,
|
category: categoryGame,
|
||||||
|
Loading…
Reference in New Issue
Block a user