From 326b57ddc49590471b2b6f7c3b075eb6b814acb9 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Tue, 26 Sep 2023 21:20:05 +0800 Subject: [PATCH] minor fix for quick absorb implementation --- CheatEnabler/DysonSpherePatch.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CheatEnabler/DysonSpherePatch.cs b/CheatEnabler/DysonSpherePatch.cs index 1723872..899ca4c 100644 --- a/CheatEnabler/DysonSpherePatch.cs +++ b/CheatEnabler/DysonSpherePatch.cs @@ -436,10 +436,18 @@ public static class DysonSpherePatch for (var i = layer.nodeCursor - 1; i > 0; i--) { var node = layer.nodePool[i]; - if (node != null && node.id == i && node.sp == node.spMax) + if (node == null || node.id != i || node.sp != node.spMax) continue; + var req = node._cpReq; + var ordered = node.cpOrdered; + if (req <= ordered) continue; + if (!swarm.AbsorbSail(node, gameTick)) continue; + ordered++; + while (req > ordered) { - node.OrderConstructCp(gameTick, swarm); - } + if (!swarm.AbsorbSail(node, gameTick)) break; + ordered++; + } + node.cpOrdered = ordered; } } }