From d6d7ebe40fa7b644fa835b4697384e6aefacb047 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Sun, 29 Dec 2024 17:41:51 +1100 Subject: [PATCH] Fix Edge Case P2P Type Changing --- .../nomilabs/mixin/betterp2p/GridServerCacheMixin.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/betterp2p/GridServerCacheMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/betterp2p/GridServerCacheMixin.java index 88f6a15e..4ddaff5b 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/betterp2p/GridServerCacheMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/betterp2p/GridServerCacheMixin.java @@ -81,8 +81,8 @@ private void properlyChangeAllP2PTypes(P2PLocation p2p, TunnelInfo newType, Call } if (tunnel.getFrequency() == 0) { - // Unbound or Inactive - // Can't rebind same frequency if inactive, as not registered in ae2 handling + // Unbound + // Just change this P2P var result = changeP2PType(tunnel, newType); cir.setReturnValue(result != null); return; @@ -98,6 +98,10 @@ private void properlyChangeAllP2PTypes(P2PLocation p2p, TunnelInfo newType, Call inputs.forEach(toModify::add); outputs.forEach(toModify::add); + // Bound P2Ps, to a frequency with no other P2Ps + if (toModify.isEmpty()) + toModify.add(tunnel); + for (var modify : toModify) { var result = changeP2PType(modify, newType); if (result == null) {