mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-25 15:35:22 +00:00
28 lines
739 B
C#
28 lines
739 B
C#
|
using System.Linq;
|
|||
|
using QSB.Events;
|
|||
|
|
|||
|
namespace QSB.DeathSync
|
|||
|
{
|
|||
|
public static class DeathPatches
|
|||
|
{
|
|||
|
public static bool PreFinishDeathSequence(DeathType deathType)
|
|||
|
{
|
|||
|
if (RespawnOnDeath.Instance.AllowedDeathTypes.Contains(deathType))
|
|||
|
{
|
|||
|
// Allow real death
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
RespawnOnDeath.Instance.ResetShip();
|
|||
|
RespawnOnDeath.Instance.ResetPlayer();
|
|||
|
|
|||
|
// Prevent original death method from running.
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public static void BroadcastDeath(DeathType deathType)
|
|||
|
{
|
|||
|
GlobalMessenger<DeathType>.FireEvent(EventNames.QSBPlayerDeath, deathType);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|