1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 10:13:31 +08:00

try to fix connection bug in feature Cut Conveyor Belt

This commit is contained in:
2025-04-15 23:38:12 +08:00
parent ac7f2ef63c
commit a3bb6ea609
2 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,15 @@ public static class FactoryFunctions
{ {
ref var belt = ref cargoTraffic.beltPool[beltId]; ref var belt = ref cargoTraffic.beltPool[beltId];
if (belt.id != beltId || belt.outputId <= 0) return; if (belt.id != beltId || belt.outputId <= 0) return;
// Clear entity connection
var factory = cargoTraffic.factory;
factory.ReadObjectConn(belt.entityId, 0, out var isOutput, out var otherObjId, out var otherSlot);
if (isOutput && factory.entityPool[otherObjId].beltId == belt.outputId) {
factory.ClearObjectConnDirect(belt.entityId, 0);
factory.ClearObjectConnDirect(otherObjId, otherSlot);
}
// Alter belt connections
var (i0, i1, i2) = (belt.rightInputId, belt.backInputId, belt.leftInputId); var (i0, i1, i2) = (belt.rightInputId, belt.backInputId, belt.leftInputId);
cargoTraffic._arrInputs(ref i0, ref i1, ref i2); cargoTraffic._arrInputs(ref i0, ref i1, ref i2);
cargoTraffic.AlterBeltConnections(beltId, 0, i0, i1, i2); cargoTraffic.AlterBeltConnections(beltId, 0, i0, i1, i2);

View File

@@ -64,7 +64,7 @@ public static class PlayerPatch
{ {
EnhancedMechaForgeCountControl.Enable(EnhancedMechaForgeCountControlEnabled.Value); EnhancedMechaForgeCountControl.Enable(EnhancedMechaForgeCountControlEnabled.Value);
HideTipsForSandsChanges.Enable(HideTipsForSandsChangesEnabled.Value); HideTipsForSandsChanges.Enable(HideTipsForSandsChangesEnabled.Value);
ShortcutKeysForStarsName.Enable(ShortcutKeysForAstrosNameEnabled.Value); ShortcutKeysForStarsName.Enable(ShortcutKeysForStarsNameEnabled.Value);
AutoNavigation.Enable(AutoNavigationEnabled.Value); AutoNavigation.Enable(AutoNavigationEnabled.Value);
} }