Skip to content

Commit

Permalink
Merge pull request #229 from project-fika/feature/disable-server-scenes
Browse files Browse the repository at this point in the history
Disable server scenes as client
  • Loading branch information
Lacyway authored Dec 12, 2024
2 parents 89d6aaa + 8ffa9c8 commit 77c4adf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Fika.Core/Coop/Patches/GClass2013_method_0_Patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Fika.Core.Coop.Utils;
using SPT.Reflection.Patching;
using System.Reflection;

namespace Fika.Core.Coop.Patches
{
internal class GClass2013_method_0_Patch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(GClass2013).GetMethod(nameof(GClass2013.method_0));
}

[PatchPrefix]
public static void Prefix(ref GStruct238 preset)
{
if (FikaBackendUtils.IsClient)
{
Logger.LogInfo("Disabling server scenes");
preset.DisableServerScenes = true;
}
}
}
}
1 change: 1 addition & 0 deletions Fika.Core/FikaPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ private static void EnableFikaPatches()
new TransitControllerAbstractClass_Exist_Patch().Enable();
new BotReload_method_1_Patch().Enable();
new Class1374_ReloadBackendLocale_Patch().Enable();
new GClass2013_method_0_Patch().Enable();
#if DEBUG
TasksExtensions_HandleFinishedTask_Patches.Enable();
new GClass1640_method_0_Patch().Enable();
Expand Down

0 comments on commit 77c4adf

Please sign in to comment.