This commit is contained in:
Noah Pilarski 2022-12-27 08:52:57 -05:00 committed by GitHub
commit c9f7e0cf12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,10 +14,9 @@ namespace NewHorizons.Patches
[HarmonyPatch(typeof(ProbeDestructionDetector), nameof(ProbeDestructionDetector.FixedUpdate))] [HarmonyPatch(typeof(ProbeDestructionDetector), nameof(ProbeDestructionDetector.FixedUpdate))]
public static bool ProbeDestructionDetector_FixedUpdate(ProbeDestructionDetector __instance) public static bool ProbeDestructionDetector_FixedUpdate(ProbeDestructionDetector __instance)
{ {
if (!AchievementHandler.Enabled) return true;
if (__instance._activeVolumes.Count > 0 && __instance._safetyVolumes.Count == 0) if (__instance._activeVolumes.Count > 0 && __instance._safetyVolumes.Count == 0)
{ {
// Mobius does SetConditionState even when you are in solar system because probe never get destroyed anywhere else but the Eye.
if (LoadManager.GetCurrentScene() == OWScene.EyeOfTheUniverse) if (LoadManager.GetCurrentScene() == OWScene.EyeOfTheUniverse)
{ {
DialogueConditionManager.SharedInstance.SetConditionState("PROBE_ENTERED_EYE", conditionState: true); DialogueConditionManager.SharedInstance.SetConditionState("PROBE_ENTERED_EYE", conditionState: true);
@ -26,7 +25,8 @@ namespace NewHorizons.Patches
else else
Debug.Log("PROBE DESTROYED"); Debug.Log("PROBE DESTROYED");
ProbeLostAchievement.Earn(); if (AchievementHandler.Enabled) ProbeLostAchievement.Earn();
Object.Destroy(__instance._probe.gameObject); Object.Destroy(__instance._probe.gameObject);
} }
__instance.enabled = false; __instance.enabled = false;