0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 07:50:46 -05:00

Disable OfflineSpawnPointPatch as spawns work without it

This commit is contained in:
Dev 2024-01-02 14:49:58 +00:00
parent 48622c7ecc
commit 45d053e300
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ namespace Aki.SinglePlayer
try try
{ {
new OfflineSaveProfilePatch().Enable(); new OfflineSaveProfilePatch().Enable();
new OfflineSpawnPointPatch().Enable(); //new OfflineSpawnPointPatch().Enable(); // Spawns are properly randomised and patch is likely no longer needed
new ExperienceGainPatch().Enable(); new ExperienceGainPatch().Enable();
new ScavExperienceGainPatch().Enable(); new ScavExperienceGainPatch().Enable();
new MainMenuControllerPatch().Enable(); new MainMenuControllerPatch().Enable();

View File

@ -51,7 +51,7 @@ namespace Aki.SinglePlayer.Patches.Progression
var spawnPointsField = (ISpawnPoints)__instance.GetType().GetFields(PatchConstants.PrivateFlags).SingleOrDefault(f => f.FieldType == typeof(ISpawnPoints))?.GetValue(__instance); var spawnPointsField = (ISpawnPoints)__instance.GetType().GetFields(PatchConstants.PrivateFlags).SingleOrDefault(f => f.FieldType == typeof(ISpawnPoints))?.GetValue(__instance);
if (spawnPointsField == null) if (spawnPointsField == null)
{ {
throw new Exception($"OfflineSpawnPointPatch: Failed to locate field of {nameof(ISpawnPoints)} on class instance ({__instance.GetType().Name})"); throw new Exception($"OfflineSpawnPointPatch: Failed to locate field: {nameof(ISpawnPoints)} on class instance: {__instance.GetType().Name}");
} }
var mapSpawnPoints = spawnPointsField.ToList(); var mapSpawnPoints = spawnPointsField.ToList();
@ -72,7 +72,7 @@ namespace Aki.SinglePlayer.Patches.Progression
Logger.LogInfo($"Desired spawnpoint: [category:{category}] [side:{side}] [infil:{infiltration}] [{mapSpawnPoints.Count} total spawn points]"); Logger.LogInfo($"Desired spawnpoint: [category:{category}] [side:{side}] [infil:{infiltration}] [{mapSpawnPoints.Count} total spawn points]");
Logger.LogInfo($"Selected SpawnPoint: [id:{__result.Id}] [name:{__result.Name}] [category:{__result.Categories}] [side:{__result.Sides}] [infil:{__result.Infiltration}]"); Logger.LogInfo($"Selected SpawnPoint: [id:{__result.Id}] [name:{__result.Name}] [category:{__result.Categories}] [side:{__result.Sides}] [infil:{__result.Infiltration}]");
return false; return false; // skip original method
} }
private static List<ISpawnPoint> FilterByPlayerSide(List<ISpawnPoint> mapSpawnPoints, ESpawnCategory category, EPlayerSide side) private static List<ISpawnPoint> FilterByPlayerSide(List<ISpawnPoint> mapSpawnPoints, ESpawnCategory category, EPlayerSide side)