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

fix not being able to use fabricator in creative mode #21

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.idea/
/.vs/
/.vscode/
packages
Releases
**/bin
Expand Down
4 changes: 2 additions & 2 deletions DeathrunRemade/Patches/PowerPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ private static void ModifySolarPanelRecharge(SolarPanel __instance, ref float __
[HarmonyPatch(typeof(CrafterLogic), nameof(CrafterLogic.ConsumeEnergy))]
private static bool PreventFabricatorConsumption(PowerRelay powerRelay, float amount, ref bool __result)
{
// Don't do anything when NoCost cheat is active.
if (GameModeUtils.IsCheatActive(GameModeOption.NoCost))
// Don't do anything when NoCost cheat is active or game mode is creative.
if (GameModeUtils.IsCheatActive(GameModeOption.NoCost) || (GameModeUtils.currentGameMode == GameModeOption.Creative))
return true;

amount = ModifyConsumeEnergy(amount, IsInRadiation(powerRelay));
Expand Down