Skip to content

Commit

Permalink
Disable ACH_BroadcastStar.OnGameTick on client
Browse files Browse the repository at this point in the history
  • Loading branch information
starfi5h committed Jul 3, 2024
1 parent 98357aa commit 50f91e7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 69 deletions.
25 changes: 25 additions & 0 deletions NebulaPatcher/Patches/Dynamic/ACH_BroadcastStar_Patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#region

using HarmonyLib;
using NebulaWorld;

#endregion

namespace NebulaPatcher.Patches.Dynamic;

[HarmonyPatch(typeof(ACH_BroadcastStar))]
internal class ACH_BroadcastStar_Patch
{
[HarmonyPrefix]
[HarmonyPatch(nameof(ACH_BroadcastStar.OnGameTick))]
[HarmonyPatch(nameof(ACH_BroadcastStar.TryAlterEntity))]
public static bool Block_On_Client_Prefix()
{
// ACH_BroadcastStar is for the achievement "Let there be light!"
// which needs to light up Artificial Star (2210) on certain planets
// Clients only have partial factories loaded so they won't get the correct stats.
// Therefore it's disabled to prevent errors.
// TODO: Try to handle global achievements syncing?
return !Multiplayer.IsActive || Multiplayer.Session.IsServer;
}
}
69 changes: 0 additions & 69 deletions NebulaPatcher/Patches/Transpilers/ACH_BroadcastStar_Transpiler.cs

This file was deleted.

0 comments on commit 50f91e7

Please sign in to comment.