mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix spawning inside cloaks fixes #671
This commit is contained in:
parent
52d20238d6
commit
41121fdc26
@ -10,11 +10,11 @@ namespace NewHorizons.Handlers
|
|||||||
{
|
{
|
||||||
public static void SetUpPlayerSpawn()
|
public static void SetUpPlayerSpawn()
|
||||||
{
|
{
|
||||||
var spawnPoint = Main.SystemDict[Main.Instance.CurrentStarSystem].SpawnPoint;
|
if (UsingCustomSpawn())
|
||||||
if (spawnPoint != null)
|
|
||||||
{
|
{
|
||||||
SearchUtilities.Find("Player_Body").GetComponent<MatchInitialMotion>().SetBodyToMatch(spawnPoint.GetAttachedOWRigidbody());
|
var spawn = GetDefaultSpawn();
|
||||||
GetPlayerSpawner().SetInitialSpawnPoint(spawnPoint);
|
SearchUtilities.Find("Player_Body").GetComponent<MatchInitialMotion>().SetBodyToMatch(spawn.GetAttachedOWRigidbody());
|
||||||
|
GetPlayerSpawner().SetInitialSpawnPoint(spawn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -44,6 +44,13 @@ namespace NewHorizons.Handlers
|
|||||||
// Arbitrary number, depending on the machine some people die, some people fall through the floor, its very inconsistent
|
// Arbitrary number, depending on the machine some people die, some people fall through the floor, its very inconsistent
|
||||||
Delay.StartCoroutine(SpawnCoroutine(30));
|
Delay.StartCoroutine(SpawnCoroutine(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var cloak = GetDefaultSpawn()?.GetAttachedOWRigidbody()?.GetComponentInChildren<CloakFieldController>();
|
||||||
|
if (cloak != null)
|
||||||
|
{
|
||||||
|
// Ensures it has invoked everything and actually placed the player in the cloaking field
|
||||||
|
cloak._firstUpdate = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SpawnShip()
|
public static void SpawnShip()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user