1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-03-22 11:53:25 +08:00

UXAssist: crash fix

This commit is contained in:
2026-03-02 22:47:05 +08:00
parent 91184ccc3a
commit 6f33669163
2 changed files with 3 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ public static class FactoryFunctions
if (stationId > 0)
{
StationComponent sc = stationPool[stationId];
if (sc.id != stationId) continue;
if (sc is null || sc.id != stationId) continue;
for (int i = 0; i < sc.storage.Length; i++)
{
int package = player.TryAddItemToPackage(sc.storage[i].itemId, sc.storage[i].count, sc.storage[i].inc, true, objId);

View File

@@ -23,6 +23,7 @@ public static class PlanetFunctions
if (stationId > 0)
{
var sc = GameMain.localPlanet.factory.transport.stationPool[stationId];
if (sc is null || sc.id != stationId) continue;
if (toBag)
{
for (var i = sc.storage.Length - 1; i >= 0; i--)
@@ -123,7 +124,7 @@ public static class PlanetFunctions
for (var i = factory.transport.stationCursor - 1; i > 0; i--)
{
var sc = stationPool[i];
if (sc.id != i) continue;
if (sc is null || sc.id != i) continue;
gameData.galacticTransport.RemoveStationComponent(sc.id);
sc.Reset();
}