Don't save relative location for now

This commit is contained in:
Noah Pilarski 2022-09-03 20:06:20 -04:00
parent f899b65eef
commit 91ff901972

View File

@ -15,16 +15,25 @@ namespace NewHorizons.Patches
return true;
}
// TODO: Figure out what causes player to fall through vessel when warping. Saving relative location will be disabled until then.
public static bool saveRelativeLocation = false;
[HarmonyPrefix]
[HarmonyPatch(typeof(VesselWarpController), nameof(VesselWarpController.WarpVessel))]
public static bool VesselWarpController_WarpVessel(VesselWarpController __instance, bool debugWarp)
{
if (!Main.Instance.IsWarpingFromVessel && TimeLoop.GetLoopCount() < 2)
Achievements.Earn(Achievements.Type.BEGINNERS_LUCK);
VesselWarpController.s_playerWarpLocation = new RelativeLocationData(Locator.GetPlayerBody(), __instance.transform);
VesselWarpController.s_relativeLocationSaved = !debugWarp;
if (saveRelativeLocation)
{
VesselWarpController.s_playerWarpLocation = new RelativeLocationData(Locator.GetPlayerBody(), __instance.transform);
VesselWarpController.s_relativeLocationSaved = !debugWarp;
}
if (!Main.Instance.IsWarpingFromVessel)
PlayerData.SaveWarpedToTheEye(TimeLoopUtilities.GetVanillaSecondsRemaining());
LoadManager.EnableAsyncLoadTransition();
return false;
}