mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Defaults for hasPhysics and hasZeroGravityVolume
This commit is contained in:
parent
9aa436c60f
commit
420c91c670
@ -201,14 +201,14 @@ namespace NewHorizons.External.Configs
|
||||
public bool spawnOnVessel;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the vessel should have physics enabled. This must be set to false for the vessel to stay attached to a parent body.
|
||||
/// Whether the vessel should have physics enabled. Defaults to false if parentBody is set, and true otherwise.
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool hasPhysics = true;
|
||||
public bool? hasPhysics;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the vessel should have a zero-gravity volume around it that ignores any other sources of gravity, like the vessel works in Dark Bramble.
|
||||
/// Whether the vessel should have a zero-gravity volume around it. Defaults to false if parentBody is set, and true otherwise.
|
||||
/// </summary>
|
||||
public bool hasZeroGravityVolume;
|
||||
public bool? hasZeroGravityVolume;
|
||||
|
||||
/// <summary>
|
||||
/// The location that the vessel will warp to.
|
||||
|
||||
@ -177,7 +177,10 @@ namespace NewHorizons.Handlers
|
||||
EyeSpawnPoint eyeSpawnPoint = vesselObject.GetComponentInChildren<EyeSpawnPoint>(true);
|
||||
system.SpawnPoint = eyeSpawnPoint;
|
||||
|
||||
if (system.Config.Vessel?.hasPhysics ?? true)
|
||||
var hasParentBody = !string.IsNullOrEmpty(system.Config.Vessel?.vesselSpawn?.parentBody);
|
||||
var hasPhysics = system.Config.Vessel?.hasPhysics ?? !hasParentBody;
|
||||
|
||||
if (hasPhysics)
|
||||
{
|
||||
vesselObject.transform.parent = null;
|
||||
}
|
||||
@ -196,7 +199,8 @@ namespace NewHorizons.Handlers
|
||||
}
|
||||
vesselWarpController._targetWarpPlatform._owRigidbody = warpExit.GetAttachedOWRigidbody();
|
||||
|
||||
if (system.Config.Vessel?.hasZeroGravityVolume ?? false)
|
||||
var hasZeroGravityVolume = system.Config.Vessel?.hasZeroGravityVolume ?? !hasParentBody;
|
||||
if (!hasZeroGravityVolume)
|
||||
{
|
||||
var zeroGVolume = vesselObject.transform.Find("Sector_VesselBridge/Volumes_VesselBridge/ZeroGVolume");
|
||||
if (zeroGVolume != null)
|
||||
|
||||
@ -366,7 +366,6 @@ namespace NewHorizons
|
||||
|
||||
// If the vessel is forcing the player to spawn there, allow it to override
|
||||
IsWarpingFromVessel = VesselWarpHandler.ShouldSpawnAtVessel();
|
||||
Logger.LogWarning("Spawning from vessel: " + IsWarpingFromVessel);
|
||||
|
||||
// Some builders have to be reset each loop
|
||||
SignalBuilder.Init();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user