check for ship ownership when killing player / vanishing ship

This commit is contained in:
Mister_Nebula 2021-06-15 18:55:54 +01:00
parent 70d80e6e19
commit 00e814920e

View File

@ -1,6 +1,7 @@
using Harmony;
using QSB.Events;
using QSB.Patches;
using QSB.ShipSync;
using QSB.Utility;
using System.Collections.Generic;
using System.Linq;
@ -192,6 +193,12 @@ namespace QSB.DeathSync.Patches
return true;
}
if (!ShipManager.Instance.HasAuthority)
{
RespawnOnDeath.Instance.ResetPlayer();
return false;
}
RespawnOnDeath.Instance.ResetShip();
RespawnOnDeath.Instance.ResetPlayer();
return false;
@ -219,6 +226,11 @@ namespace QSB.DeathSync.Patches
return true;
}
if (!ShipManager.Instance.HasAuthority)
{
return false;
}
if (PlayerState.IsInsideShip() || PlayerState.UsingShipComputer() || PlayerState.AtFlightConsole())
{
Locator.GetDeathManager().KillPlayer(____deathType);