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