respawnHere

This commit is contained in:
Noah Pilarski 2023-01-14 16:57:41 -05:00
parent a974f354fd
commit fd9dc69fb1
2 changed files with 10 additions and 5 deletions

View File

@ -56,11 +56,17 @@ namespace NewHorizons.External.Configs
public SkyboxModule Skybox; public SkyboxModule Skybox;
/// <summary> /// <summary>
/// Set to `true` if you want to spawn here after dying, not Timber Hearth. You can still warp back to the main star /// Set to `true` if you want to spawn here after dying, not Timber Hearth. You can still warp back to the main star.
/// system. /// system.
/// </summary> /// </summary>
public bool startHere; public bool startHere;
/// <summary>
/// Set to `true` if you want the player to stay in this star system if they die in it.
/// system.
/// </summary>
public bool respawnHere;
[Obsolete("travelAudioClip is deprecated, please use travelAudio instead")] [Obsolete("travelAudioClip is deprecated, please use travelAudio instead")]
public string travelAudioClip; public string travelAudioClip;
@ -238,7 +244,7 @@ namespace NewHorizons.External.Configs
// False by default so if one is true go true // False by default so if one is true go true
mapRestricted = mapRestricted || otherConfig.mapRestricted; mapRestricted = mapRestricted || otherConfig.mapRestricted;
mapRestricted = mapRestricted || otherConfig.mapRestricted; respawnHere = respawnHere || otherConfig.respawnHere;
startHere = startHere || otherConfig.startHere; startHere = startHere || otherConfig.startHere;
Vessel = Vessel == null ? otherConfig.Vessel : Vessel; Vessel = Vessel == null ? otherConfig.Vessel : Vessel;

View File

@ -819,18 +819,17 @@ namespace NewHorizons
// We reset the solar system on death // We reset the solar system on death
if (!IsChangingStarSystem) if (!IsChangingStarSystem)
{ {
if (SystemDict[_currentStarSystem].Config.respawnHere) return;
// If the override is a valid system then we go there // If the override is a valid system then we go there
if (SystemDict.ContainsKey(_defaultSystemOverride)) if (SystemDict.ContainsKey(_defaultSystemOverride))
{ {
_currentStarSystem = _defaultSystemOverride; _currentStarSystem = _defaultSystemOverride;
IsWarpingFromShip = true; // always do this else sometimes the spawn gets messed up
} }
else else
{ {
_currentStarSystem = _defaultStarSystem; _currentStarSystem = _defaultStarSystem;
} }
IsWarpingFromShip = false;
} }
} }
#endregion Change star system #endregion Change star system