1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-02-04 18:22:18 +08:00

Compare commits

..

2 Commits

4 changed files with 26 additions and 24 deletions

View File

@@ -3,6 +3,9 @@
## Changlog
* 1.3.3
+ `Re-initialize planet`: Fix a crash.
+ `Auto navigation on sailings`: Do not auto-use Warper if required Tech is not researched.
* 1.3.2
+ New feature: `Disable battle-related techs in Peace mode`
+ New button: `Unlock all techs with metadata`

View File

@@ -93,6 +93,28 @@ public static class PlanetFunctions
planet.audio?.RemoveAudioData(ed.audioId);
}
var hives = GameMain.spaceSector?.dfHives;
if (hives != null)
{
var hive = hives[planet.star.index];
var relays = hive?.relays?.buffer;
if (relays != null)
{
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();
}
}
}
if (planet.factory.enemyPool != null)
{
for (var i = planet.factory.enemyCursor - 1; i > 0; i--)
@@ -151,27 +173,6 @@ public static class PlanetFunctions
if (warningPool[i].id == i && warningPool[i].factoryId == index)
warningSystem.RemoveWarningData(warningPool[i].id);
}
var hives = GameMain.spaceSector?.dfHives;
if (hives != null)
{
var hive = hives[planet.star.index];
var relays = hive?.relays?.buffer;
if (relays != null)
{
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;
factory.entityCursor = 1;
factory.entityRecycleCursor = 0;

View File

@@ -410,7 +410,7 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
/* Check nearest astroes, try to bypass them */
var localStar = GameMain.localStar;
_canUseWarper = autoCruise && !player.warping && player.mecha.warpStorage.GetItemCount(1210) > 0;
_canUseWarper = autoCruise && player.mecha.thrusterLevel >= 3 && !player.warping && player.mecha.HasWarper();
if (localStar != null)
{
var nearestRange = (playerPos - localStar.uPosition).sqrMagnitude;

View File

@@ -2,5 +2,3 @@
* Starmap filter: top windows overlap fix
* Set battlefield analysis base power charging
* Auto-navigation: avoid darkfogs
* Auto-navigation: do not use warper if the tech is not researched
* Recreate planet: crash fix