mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix vessel spawn overriding other spawns
This commit is contained in:
parent
094968187b
commit
5805908e6d
@ -45,7 +45,7 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
var vesselConfig = SystemDict[Instance.CurrentStarSystem].Config?.Vessel;
|
||||
var shouldSpawnOnVessel = IsVesselPresent() && (vesselConfig?.spawnOnVessel ?? false);
|
||||
return Instance.IsWarpingFromVessel || shouldSpawnOnVessel;
|
||||
return !Instance.IsWarpingFromShip && (Instance.IsWarpingFromVessel || shouldSpawnOnVessel);
|
||||
}
|
||||
|
||||
public static void LoadVessel()
|
||||
@ -174,9 +174,6 @@ namespace NewHorizons.Handlers
|
||||
|
||||
vesselObject.GetComponent<MapMarker>()._labelID = (UITextType)TranslationHandler.AddUI("Vessel");
|
||||
|
||||
EyeSpawnPoint eyeSpawnPoint = vesselObject.GetComponentInChildren<EyeSpawnPoint>(true);
|
||||
system.SpawnPoint = eyeSpawnPoint;
|
||||
|
||||
var hasParentBody = !string.IsNullOrEmpty(system.Config.Vessel?.vesselSpawn?.parentBody);
|
||||
var hasPhysics = system.Config.Vessel?.hasPhysics ?? !hasParentBody;
|
||||
|
||||
@ -209,6 +206,12 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
EyeSpawnPoint eyeSpawnPoint = vesselObject.GetComponentInChildren<EyeSpawnPoint>(true);
|
||||
if (ShouldSpawnAtVessel())
|
||||
{
|
||||
system.SpawnPoint = eyeSpawnPoint;
|
||||
}
|
||||
|
||||
vesselObject.SetActive(true);
|
||||
|
||||
Delay.FireOnNextUpdate(() => SetupWarpController(vesselWarpController));
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using HarmonyLib;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Patches.PlayerPatches
|
||||
@ -15,12 +16,15 @@ namespace NewHorizons.Patches.PlayerPatches
|
||||
Logger.LogWarning("Abort player spawn. Vessel will handle it.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
else if (Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint != null)
|
||||
{
|
||||
Logger.LogVerbose("Player spawning");
|
||||
Logger.LogVerbose($"Player spawning at {Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint.transform.GetPath()}");
|
||||
__instance.SetInitialSpawnPoint(Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint);
|
||||
} else if (Main.Instance.CurrentStarSystem != "SolarSystem" && Main.Instance.CurrentStarSystem != "EyeOfTheUniverse")
|
||||
{
|
||||
Logger.LogWarning("No player spawn point set.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user