mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
Fix ship destroyed not counting sun/lava
This commit is contained in:
parent
bd496c1c56
commit
967147dc5d
@ -29,7 +29,7 @@ public class RespawnHUDMarker : HUDDistanceMarker
|
||||
{
|
||||
var isVisible = _canvasMarker.IsVisible();
|
||||
var shouldBeVisible = RespawnManager.Instance.RespawnNeeded
|
||||
&& !ShipManager.Instance.ShipCockpitUI._shipDamageCtrlr.IsDestroyed();
|
||||
&& !ShipManager.Instance.IsShipWrecked;
|
||||
|
||||
if (shouldBeVisible != isVisible)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ internal class ShipRecoveryPoint : MonoBehaviour
|
||||
_playerResources = Locator.GetPlayerTransform().GetComponent<PlayerResources>();
|
||||
}
|
||||
|
||||
if (RespawnManager.Instance.RespawnNeeded && !ShipManager.Instance.ShipCockpitUI._shipDamageCtrlr.IsDestroyed())
|
||||
if (RespawnManager.Instance.RespawnNeeded && !ShipManager.Instance.IsShipWrecked)
|
||||
{
|
||||
_interactVolume.EnableSingleInteraction(true, _respawnIndex);
|
||||
_interactVolume.SetKeyCommandVisible(true, _respawnIndex);
|
||||
@ -127,7 +127,7 @@ internal class ShipRecoveryPoint : MonoBehaviour
|
||||
}
|
||||
else if (inputCommand == _interactVolume.GetInteractionAt(_respawnIndex).inputCommand)
|
||||
{
|
||||
if (!RespawnManager.Instance.RespawnNeeded || ShipManager.Instance.ShipCockpitUI._shipDamageCtrlr.IsDestroyed())
|
||||
if (!RespawnManager.Instance.RespawnNeeded || ShipManager.Instance.IsShipWrecked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -42,15 +42,28 @@ internal class ShipManager : WorldObjectManager
|
||||
_currentFlyer = value;
|
||||
}
|
||||
}
|
||||
public bool IsShipWrecked => _shipDestroyed || ShipCockpitUI._shipDamageCtrlr.IsDestroyed();
|
||||
|
||||
private readonly List<PlayerInfo> _playersInShip = new();
|
||||
|
||||
private uint _currentFlyer = uint.MaxValue;
|
||||
private bool _shipDestroyed;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Instance = this;
|
||||
QSBPlayerManager.OnRemovePlayer += OnRemovePlayer;
|
||||
GlobalMessenger.AddListener("ShipDestroyed", OnShipDestroyed);
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
GlobalMessenger.RemoveListener("ShipDestroyed", OnShipDestroyed);
|
||||
}
|
||||
|
||||
private void OnShipDestroyed()
|
||||
{
|
||||
_shipDestroyed = true;
|
||||
}
|
||||
|
||||
private void OnRemovePlayer(PlayerInfo player)
|
||||
@ -63,6 +76,8 @@ internal class ShipManager : WorldObjectManager
|
||||
|
||||
public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
|
||||
{
|
||||
_shipDestroyed = false;
|
||||
|
||||
var shipBody = Locator.GetShipBody();
|
||||
if (shipBody == null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user