Skip to content

Commit b87ae4c

Browse files
committed
Added a config that disabled SCP-2536 spawning.
1 parent 407b871 commit b87ae4c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

LabExtended/Core/Configs/ApiConfig.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ public class ApiConfig
1414
/// </summary>
1515
[Description("Sets the chance of SCP-559 using the Capybara model.")]
1616
public float? Scp956CapybaraChance { get; set; } = null;
17+
18+
/// <summary>
19+
/// Gets or sets a value indicating whether SCP-2536 spawning should be disabled.
20+
/// </summary>
21+
[Description("Whether or not the SCP-2536 should be prevented from spawning.")]
22+
public bool Scp2536Disabled { get; set; }
1723

1824
/// <summary>
1925
/// Gets or sets the configuration settings for file storage.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Christmas.Scp2536;
2+
3+
using HarmonyLib;
4+
5+
using LabExtended.Core;
6+
7+
namespace LabExtended.Patches.Functions.Holidays
8+
{
9+
/// <summary>
10+
/// Prevents the SCP-2536 tree from spawning (if the Scp2536Disabled config is enabled) by failing the target locator.
11+
/// </summary>
12+
public static class Scp2536SpawnPreventionPatch
13+
{
14+
[HarmonyPatch(typeof(Scp2536Controller), nameof(Scp2536Controller.ServerFindTarget))]
15+
private static bool Prefix(ref bool __result)
16+
{
17+
if (ApiLoader.ApiConfig != null && ApiLoader.ApiConfig.Scp2536Disabled)
18+
{
19+
__result = false;
20+
return false;
21+
}
22+
23+
return true;
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)