fixed respawnondeath

This commit is contained in:
Mister_Nebula 2020-12-19 21:47:19 +00:00
parent 9677ab3928
commit d2c8ba5d11
2 changed files with 3 additions and 15 deletions

View File

@ -28,21 +28,7 @@ namespace QSB.DeathSync
private ShipCockpitController _cockpitController;
private PlayerSpacesuit _spaceSuit;
public void Awake()
{
Instance = this;
QSBCore.Helper.Events.Subscribe<PlayerResources>(OWML.Common.Events.AfterStart);
QSBCore.Helper.Events.Event += OnEvent;
}
private void OnEvent(MonoBehaviour behaviour, OWML.Common.Events ev)
{
if (behaviour is PlayerResources && ev == OWML.Common.Events.AfterStart)
{
Init();
}
}
public void Awake() => Instance = this;
public void Init()
{

View File

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