1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 19:33:28 +08:00

UXAssist v1.3.2

This commit is contained in:
2025-04-28 19:40:25 +08:00
parent 5545d7a2bf
commit f407928579
6 changed files with 509 additions and 299 deletions

View File

@@ -151,20 +151,25 @@ public static class PlanetFunctions
if (warningPool[i].id == i && warningPool[i].factoryId == index)
warningSystem.RemoveWarningData(warningPool[i].id);
}
var hive = GameMain.spaceSector.dfHives[planet.star.index];
var relays = hive.relays.buffer;
var astroId = planet.astroId;
for (var i = relays.Length - 1; i >= 0; i--)
var hives = GameMain.spaceSector?.dfHives;
if (hives != null)
{
var relay = relays[i];
if (relay.id != i) continue;
if (relay.targetAstroId == astroId || relay.searchAstroId == astroId)
var hive = hives[planet.star.index];
var relays = hive?.relays?.buffer;
if (relays != null)
{
relay.targetAstroId = 0;
relay.searchAstroId = 0;
if (relay.baseId > 0)
hive.relayNeutralizedCounter++;
relay.LeaveBase();
var astroId = planet.astroId;
for (var i = relays.Length - 1; i >= 0; i--)
{
var relay = relays[i];
if (relay != null && relay.id != i) continue;
if (relay.targetAstroId != astroId && relay.searchAstroId != astroId) continue;
relay.targetAstroId = 0;
relay.searchAstroId = 0;
if (relay.baseId > 0)
hive.relayNeutralizedCounter++;
relay.LeaveBase();
}
}
}
var isCombatMode = factory.gameData.gameDesc.isCombatMode;