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

Disable server scenes as client #229

Merged
merged 1 commit into from
Dec 12, 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
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
Loading