mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 11:39:54 +00:00
Fix
This commit is contained in:
1 parent
121539c61d
commit
ab8bd822f3
3 files changed
+13
-20
No files matched your search
@@ -312,8 +312,14 @@ static class GameEndChecker
|
||||
|
||||
private static void StartEndGame(GameOverReason reason)
|
||||
{
|
||||
var msg = GetString("NotifyGameEnding");
|
||||
Main.AllPlayerControls.DoIf(
|
||||
x => x.GetClient() != null && !x.Data.Disconnected,
|
||||
x => ChatUpdatePatch.SendMessage(PlayerControl.LocalPlayer, "\n", x.PlayerId, msg));
|
||||
|
||||
SetEverythingUpPatch.LastWinsReason = WinnerTeam is CustomWinner.Crewmate or CustomWinner.Impostor ? GetString($"GameOverReason.{reason}") : string.Empty;
|
||||
AmongUsClient.Instance.StartCoroutine(CoEndGame(AmongUsClient.Instance, reason).WrapToIl2Cpp());
|
||||
AmongUsClient self = AmongUsClient.Instance;
|
||||
self.StartCoroutine(CoEndGame(self, reason).WrapToIl2Cpp());
|
||||
}
|
||||
|
||||
private static IEnumerator CoEndGame(InnerNetClient self, GameOverReason reason)
|
||||
@@ -370,7 +376,7 @@ static class GameEndChecker
|
||||
playerInfo.IsDead = false;
|
||||
// transmission
|
||||
playerInfo.SetDirtyBit(0b_1u << playerId);
|
||||
AmongUsClient.Instance.SendAllStreamedObjects();
|
||||
self.SendAllStreamedObjects();
|
||||
}
|
||||
|
||||
// Delay to ensure that the end of the game is delivered at the end of the game
|
||||
@@ -887,17 +893,4 @@ static class CheckGameEndPatch
|
||||
__result = GameEndChecker.Predicate?.CheckGameEndByTask(out _) ?? false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(GameManager), nameof(GameManager.RpcEndGame))]
|
||||
static class RpcEndGamePatch
|
||||
{
|
||||
public static void Prefix()
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
var msg = GetString("NotifyGameEnding");
|
||||
Main.AllPlayerControls.DoIf(
|
||||
x => x.GetClient() != null && !x.Data.Disconnected,
|
||||
x => ChatUpdatePatch.SendMessage(PlayerControl.LocalPlayer, "\n", x.PlayerId, msg));
|
||||
}
|
||||
}
|
||||
@@ -192,11 +192,10 @@ static class CheckForEndVotingPatch
|
||||
}
|
||||
}
|
||||
|
||||
if (RunRoleCode)
|
||||
{
|
||||
Blackmailer.OnCheckForEndVoting();
|
||||
NiceSwapper.OnCheckForEndVoting();
|
||||
}
|
||||
if (!RunRoleCode) return false;
|
||||
|
||||
Blackmailer.OnCheckForEndVoting();
|
||||
NiceSwapper.OnCheckForEndVoting();
|
||||
|
||||
states = [.. statesList];
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace EHR.Crewmate
|
||||
state.RealKiller = (DateTime.Now, target.PlayerId);
|
||||
state.SetDead();
|
||||
reporter.RpcExileV2();
|
||||
FixedUpdatePatch.LoversSuicide(reporter.PlayerId);
|
||||
|
||||
RevivingMode = false;
|
||||
ReviveTarget = target.PlayerId;
|
||||
|
||||
Reference in new issue
Block a user