mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add isDefault flag to planet spawns
This commit is contained in:
parent
6e93ac01f8
commit
094968187b
4
NewHorizons/External/Modules/SpawnModule.cs
vendored
4
NewHorizons/External/Modules/SpawnModule.cs
vendored
@ -29,6 +29,10 @@ namespace NewHorizons.External.Modules
|
|||||||
/// If you spawn on a planet with no oxygen, you probably want to set this to true ;;)
|
/// If you spawn on a planet with no oxygen, you probably want to set this to true ;;)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool startWithSuit;
|
public bool startWithSuit;
|
||||||
|
/// <summary>
|
||||||
|
/// Whether this planet's spawn point is the one the player will initially spawn at, if multiple spawn points exist.
|
||||||
|
/// </summary>
|
||||||
|
public bool isDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
@ -454,7 +454,11 @@ namespace NewHorizons.Handlers
|
|||||||
if (body.Config.Spawn != null)
|
if (body.Config.Spawn != null)
|
||||||
{
|
{
|
||||||
Logger.LogVerbose("Making spawn point");
|
Logger.LogVerbose("Making spawn point");
|
||||||
Main.SystemDict[body.Config.starSystem].SpawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody);
|
var spawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody);
|
||||||
|
if (Main.SystemDict[body.Config.starSystem].SpawnPoint == null || (body.Config.Spawn.playerSpawn?.isDefault ?? false))
|
||||||
|
{
|
||||||
|
Main.SystemDict[body.Config.starSystem].SpawnPoint = spawnPoint;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic)
|
if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user