mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
21 lines
572 B
C#
21 lines
572 B
C#
using HarmonyLib;
|
|
using MiraAPI.GameModes;
|
|
|
|
namespace MiraAPI.Patches.GameModes;
|
|
|
|
[HarmonyPatch(typeof(GameManager))]
|
|
internal static class OnDeathPatch
|
|
{
|
|
[HarmonyPrefix, HarmonyPatch(nameof(GameManager.OnPlayerDeath))]
|
|
public static bool OnDeathPostfix([HarmonyArgument(0)] PlayerControl player, [HarmonyArgument(1)] bool assignGhostRole)
|
|
{
|
|
if (CustomGameModeManager.ActiveMode != null)
|
|
{
|
|
CustomGameModeManager.ActiveMode.OnPlayerDeath(player, assignGhostRole);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|