mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
MAY have fixed T1-T2 kicking.... also reverted GameOptionsMenuPatch.cs changes to 7.2.2 and did some other fixes
This commit is contained in:
1 parent
75df30d923
commit
a67a5c58a1
28 files changed
+482
-555
No files matched your search
@@ -119,32 +119,38 @@ public abstract class GameOptionsSender
|
||||
|
||||
public static IEnumerator SendDirtyGameOptionsContinuously()
|
||||
{
|
||||
while (GameStates.InGame || GameStates.IsLobby)
|
||||
try
|
||||
{
|
||||
for (var index = 0; index < AllSenders.Count; index++)
|
||||
while (GameStates.InGame || GameStates.IsLobby)
|
||||
{
|
||||
GameOptionsSender sender = AllSenders[index];
|
||||
|
||||
yield return WaitFrameIfNecessary();
|
||||
|
||||
if (sender == null || !sender.AmValid())
|
||||
for (var index = 0; index < AllSenders.Count; index++)
|
||||
{
|
||||
AllSenders.RemoveAt(index);
|
||||
index--;
|
||||
continue;
|
||||
yield return WaitFrameIfNecessary();
|
||||
|
||||
if (index >= AllSenders.Count) break;
|
||||
GameOptionsSender sender = AllSenders[index];
|
||||
|
||||
if (sender == null || !sender.AmValid())
|
||||
{
|
||||
AllSenders.RemoveAt(index);
|
||||
index--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sender.IsDirty)
|
||||
yield return sender.SendGameOptionsAsync();
|
||||
|
||||
sender.IsDirty = false;
|
||||
}
|
||||
|
||||
if (sender.IsDirty)
|
||||
yield return sender.SendGameOptionsAsync();
|
||||
|
||||
sender.IsDirty = false;
|
||||
ForceWaitFrame = true;
|
||||
yield return WaitFrameIfNecessary();
|
||||
}
|
||||
|
||||
ForceWaitFrame = true;
|
||||
yield return WaitFrameIfNecessary();
|
||||
}
|
||||
|
||||
ActiveCoroutine = null;
|
||||
finally
|
||||
{
|
||||
ActiveCoroutine = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected static IEnumerator WaitFrameIfNecessary()
|
||||
|
||||
@@ -687,7 +687,7 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
|
||||
|
||||
protected override bool AmValid()
|
||||
{
|
||||
return base.AmValid() && player != null && player.Data != null && !player.Data.Disconnected && Main.RealOptionsData != null;
|
||||
return base.AmValid() && player && player.Data && !player.Data.Disconnected && Main.RealOptionsData != null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user