Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mod to work with latest version of DSP 0.6.17.6112. #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions AssemblerVerticalConstruction/AssemblerVerticalConstruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public static void GameTickPatch(FactorySystem __instance, long time, bool isAct
return ;
}

public static void SyncAssemblerFunctions(FactorySystem factorySystem, StorageComponent package, int assemblerId)
public static void SyncAssemblerFunctions(FactorySystem factorySystem, Player player, int assemblerId)
{
var _this = factorySystem;
int entityId = _this.assemblerPool[assemblerId].entityId;
Expand All @@ -224,13 +224,13 @@ public static void SyncAssemblerFunctions(FactorySystem factorySystem, StorageCo
{
if (_this.assemblerPool[assemblerId2].recipeId != _this.assemblerPool[assemblerId].recipeId)
{
_this.TakeBackItems_Assembler(package, assemblerId2);
_this.TakeBackItems_Assembler(player, assemblerId2);
_this.assemblerPool[assemblerId2].SetRecipe(_this.assemblerPool[assemblerId].recipeId, _this.factory.entitySignPool);
}
}
else if ( _this.assemblerPool[assemblerId2].recipeId != 0)
{
_this.TakeBackItems_Assembler(package, assemblerId2);
_this.TakeBackItems_Assembler(player, assemblerId2);
_this.assemblerPool[assemblerId2].SetRecipe(0, _this.factory.entitySignPool);
}
}
Expand Down Expand Up @@ -259,13 +259,13 @@ public static void SyncAssemblerFunctions(FactorySystem factorySystem, StorageCo
{
if ( _this.assemblerPool[assemblerId3].recipeId != _this.assemblerPool[assemblerId].recipeId)
{
_this.TakeBackItems_Assembler(package, assemblerId3);
_this.TakeBackItems_Assembler(player, assemblerId3);
_this.assemblerPool[assemblerId3].SetRecipe(_this.assemblerPool[assemblerId].recipeId, _this.factory.entitySignPool);
}
}
else if (_this.assemblerPool[assemblerId3].recipeId != 0)
{
_this.TakeBackItems_Assembler(package, assemblerId3);
_this.TakeBackItems_Assembler(player, assemblerId3);
_this.assemblerPool[assemblerId3].SetRecipe(0, _this.factory.entitySignPool);
}
}
Expand All @@ -290,7 +290,7 @@ public static void OnRecipeResetClickPatch(UIAssemblerWindow __instance)
{
return;
}
SyncAssemblerFunctions(__instance.factorySystem, __instance.player.package, __instance.assemblerId);
SyncAssemblerFunctions(__instance.factorySystem, __instance.player, __instance.assemblerId);
}

[HarmonyPostfix, HarmonyPatch(typeof(UIAssemblerWindow), "OnRecipePickerReturn")]
Expand All @@ -305,7 +305,7 @@ public static void OnRecipePickerReturnPatch(UIAssemblerWindow __instance)
{
return;
}
SyncAssemblerFunctions(__instance.factorySystem, __instance.player.package, __instance.assemblerId);
SyncAssemblerFunctions(__instance.factorySystem, __instance.player, __instance.assemblerId);
}

[HarmonyPostfix, HarmonyPatch(typeof(PlanetFactory), "PasteEntitySetting")]
Expand All @@ -322,7 +322,7 @@ public static void PasteEntitySettingPatch(PlanetFactory __instance, int entityI
ItemProto itemProto = LDB.items.Select((int)__instance.entityPool[entityId].protoId);
if (itemProto != null && itemProto.prefabDesc != null)
{
SyncAssemblerFunctions(__instance.factorySystem, __instance.gameData.mainPlayer.package, assemblerId);
SyncAssemblerFunctions(__instance.factorySystem, __instance.gameData.mainPlayer, assemblerId);
}
}

Expand Down