fix missed code paths for artificially reduced splitter throughput

This commit is contained in:
2026-06-14 14:35:43 +02:00
parent 0a1b58442c
commit 8451f5a281
2 changed files with 111 additions and 13 deletions

View File

@@ -720,11 +720,18 @@ void BeltSystem::routeSplitterItems()
bool routed = false;
// A front slot holds only one item, so an item entering at progress 0.0
// would have to traverse the whole tile before the next could enter,
// throttling that output below belt speed and leaving large gaps. Entering
// near the output edge lets the slot clear roughly every quarter tile, so
// the output stays packed (fixes the half-blocked / single-output gap bug).
constexpr double frontEntryProgress = 0.75;
if (matchesA && !matchesB)
{
if (!st.frontA)
{
st.frontA = BeltItemSlot{item, 0.0};
st.frontA = BeltItemSlot{item, frontEntryProgress};
routed = true;
}
}
@@ -732,7 +739,7 @@ void BeltSystem::routeSplitterItems()
{
if (!st.frontB)
{
st.frontB = BeltItemSlot{item, 0.0};
st.frontB = BeltItemSlot{item, frontEntryProgress};
routed = true;
}
}
@@ -743,26 +750,26 @@ void BeltSystem::routeSplitterItems()
if (preferA && !st.frontA)
{
st.frontA = BeltItemSlot{item, 0.0};
st.frontA = BeltItemSlot{item, frontEntryProgress};
st.nextOutputIsA = false;
routed = true;
}
else if (!preferA && !st.frontB)
{
st.frontB = BeltItemSlot{item, 0.0};
st.frontB = BeltItemSlot{item, frontEntryProgress};
st.nextOutputIsA = true;
routed = true;
}
else if (preferA && !st.frontB)
{
// Preferred (A) is full — fall back to B; nextOutputIsA stays.
st.frontB = BeltItemSlot{item, 0.75};
st.frontB = BeltItemSlot{item, frontEntryProgress};
routed = true;
}
else if (!preferA && !st.frontA)
{
// Preferred (B) is full — fall back to A; nextOutputIsA stays.
st.frontA = BeltItemSlot{item, 0.75};
st.frontA = BeltItemSlot{item, frontEntryProgress};
routed = true;
}
// else both fronts occupied — back stays.