added for player as well

This commit is contained in:
Mister_Nebula 2020-12-19 22:03:00 +00:00
parent 804680ba0c
commit 4501b2511f
2 changed files with 7 additions and 3 deletions

View File

@ -59,7 +59,7 @@ namespace QSB.DeathSync
{
if (_shipSpawnPoint == null)
{
DebugLog.ToConsole("_shipSpawnPoint is null!", MessageType.Warning);
DebugLog.ToConsole("Warning - _shipSpawnPoint is null!", MessageType.Warning);
Init();
}
@ -95,6 +95,12 @@ namespace QSB.DeathSync
public void ResetPlayer()
{
if (_shipSpawnPoint == null)
{
DebugLog.ToConsole("Warning - _playerSpawnPoint is null!", MessageType.Warning);
Init();
}
// Reset player position.
var playerBody = Locator.GetPlayerBody();
playerBody.WarpToPositionRotation(_playerSpawnPoint.transform.position, _playerSpawnPoint.transform.rotation);

View File

@ -180,8 +180,6 @@ namespace QSB
gameObject.AddComponent<RespawnOnDeath>();
gameObject.AddComponent<PreventShipDestruction>();
QSBCore.Helper.Events.Unity.RunWhen(() => QSBCore.HasWokenUp, RespawnOnDeath.Instance.Init);
if (QSBSceneManager.IsInUniverse)
{
QSBSectorManager.Instance.RebuildSectors();