This commit is contained in:
Gurge44 committed 2024-10-01 19:22:18 +02:00
1 parent 121539c61d
commit ab8bd822f3
3 files changed
+13 -20

No files matched your search

+8 -15
View File
@@ -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));
}
}
+4 -5
View File
@@ -192,11 +192,10 @@ static class CheckForEndVotingPatch
}
}
if (RunRoleCode)
{
Blackmailer.OnCheckForEndVoting();
NiceSwapper.OnCheckForEndVoting();
}
if (!RunRoleCode) return false;
Blackmailer.OnCheckForEndVoting();
NiceSwapper.OnCheckForEndVoting();
states = [.. statesList];
+1
View File
@@ -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;