CNOS WORK AGAIN

This commit is contained in:
Gurge44 committed 2026-01-23 10:22:29 +01:00
1 parent 79f08bf403
commit 62e6946af3
4 files changed
+16 -11

No files matched your search

+2
View File
@@ -289,6 +289,7 @@ public enum CustomRoles
// Neutrals
Accumulator,
Agitator,
Amnesiac,
Amogus,
@@ -358,6 +359,7 @@ public enum CustomRoles
Pulse,
Pursuer,
Pyromaniac,
Quarry,
QuizMaster,
Reckless,
Revolutionist,
+5 -4
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using AmongUs.InnerNet.GameDataMessages;
@@ -177,7 +178,7 @@ namespace EHR
protected void CreateNetObject(string sprite, Vector2 position)
{
if (GameStates.IsEnded || !AmongUsClient.Instance.AmHost || GameStates.CurrentServerType == GameStates.ServerType.Vanilla) return;
if (GameStates.IsEnded || !AmongUsClient.Instance.AmHost) return;
Logger.Info($" Create Custom Net Object {GetType().Name} (ID {MaxId + 1}) at {position} - Time since game start: {Utils.TimeStamp - IntroCutsceneDestroyPatch.IntroDestroyTS}s", "CNO.CreateNetObject");
@@ -187,7 +188,7 @@ namespace EHR
{
Main.Instance.StartCoroutine(CoRoutine());
System.Collections.IEnumerator CoRoutine()
IEnumerator CoRoutine()
{
Logger.Info("Delaying CNO Spawn", "CustomNetObject.CreateNetObject");
while (GameStates.InGame && !GameStates.IsEnded && (!Main.IntroDestroyed || Utils.TimeStamp - IntroCutsceneDestroyPatch.IntroDestroyTS < 10)) yield return null;
@@ -366,7 +367,7 @@ namespace EHR
Main.Instance.StartCoroutine(WaitForMeetingEnd());
return;
System.Collections.IEnumerator WaitForMeetingEnd()
IEnumerator WaitForMeetingEnd()
{
yield return new WaitForSecondsRealtime(5f);
while (ReportDeadBodyPatch.MeetingStarted || GameStates.IsMeeting || ExileController.Instance || AntiBlackout.SkipTasks) yield return null;
@@ -897,7 +898,7 @@ namespace EHR
{
public FallenTree(Vector2 position)
{
CreateNetObject(EHR.Roles.Tree.FallenSprite, position);
CreateNetObject(Roles.Tree.FallenSprite, position);
}
}
+2
View File
@@ -3335,6 +3335,7 @@ public static class Utils
return true;
}
/*
public static void SendGameData()
{
int messages = 0;
@@ -3368,6 +3369,7 @@ public static class Utils
AmongUsClient.Instance.SendOrDisconnect(writer);
writer.Recycle();
}
*/
public static void SendGameDataTo(int targetClientId)
{
+7 -7
View File
@@ -1173,12 +1173,12 @@ public static class GameSettingMenuPatch
var gms = Enum.GetValues<CustomGameMode>()[..^1].ToList();
gms.Remove(CustomGameMode.TheMindGame);
if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla)
{
gms.Remove(CustomGameMode.CaptureTheFlag);
gms.Remove(CustomGameMode.NaturalDisasters);
gms.Remove(CustomGameMode.BedWars);
}
// if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla)
// {
// gms.Remove(CustomGameMode.CaptureTheFlag);
// gms.Remove(CustomGameMode.NaturalDisasters);
// gms.Remove(CustomGameMode.BedWars);
// }
if (SubmergedCompatibility.Loaded && Main.NormalOptions.MapId == 6)
gms.RemoveAll(SubmergedCompatibility.IsNotSupported);
@@ -1192,7 +1192,7 @@ public static class GameSettingMenuPatch
gms.Remove(CustomGameMode.Deathrace);
}
int totalCols = 3;
const int totalCols = 3;
GMButtons = [];