mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Improve the map inoperable patch
This commit is contained in:
parent
eb38bfb14d
commit
f39973f12a
@ -1,4 +1,6 @@
|
||||
using HarmonyLib;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace NewHorizons.Patches
|
||||
{
|
||||
[HarmonyPatch]
|
||||
@ -26,12 +28,18 @@ namespace NewHorizons.Patches
|
||||
[HarmonyPatch(typeof(MapController), nameof(MapController.MapInoperable))]
|
||||
public static bool MapController_MapInoperable(MapController __instance, ref bool __result)
|
||||
{
|
||||
if(Main.SystemDict[Main.Instance.CurrentStarSystem]?.Config?.mapRestricted ?? false)
|
||||
if (SceneManager.GetActiveScene().name != "SolarSystem") return true;
|
||||
|
||||
try
|
||||
{
|
||||
__instance._playerMapRestricted = true;
|
||||
__result = true;
|
||||
return false;
|
||||
if (Main.SystemDict[Main.Instance.CurrentStarSystem].Config.mapRestricted)
|
||||
{
|
||||
__instance._playerMapRestricted = true;
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user