mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
27 lines
853 B
C#
27 lines
853 B
C#
using HarmonyLib;
|
|
using Logger = NewHorizons.Utility.Logger;
|
|
|
|
namespace NewHorizons.Patches.PlayerPatches
|
|
{
|
|
[HarmonyPatch(typeof(PlayerSpawner))]
|
|
public static class PlayerSpawnerPatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(nameof(PlayerSpawner.SpawnPlayer))]
|
|
public static bool PlayerSpawner_SpawnPlayer(PlayerSpawner __instance)
|
|
{
|
|
if (Main.Instance.IsWarpingFromVessel || Main.Instance.DidWarpFromVessel)
|
|
{
|
|
Logger.LogWarning("Abort player spawn. Vessel will handle it.");
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
Logger.LogVerbose("Player spawning");
|
|
__instance.SetInitialSpawnPoint(Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint);
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|