add check

This commit is contained in:
Gurge44 committed 2026-05-25 12:07:03 +02:00
1 parent f72bab5792
commit fc9ced76ab
2 files changed
+31 -28

No files matched your search

+30 -27
View File
@@ -678,43 +678,46 @@ internal static class GameEndChecker
if (CustomTeamManager.CheckCustomTeamGameEnd()) return true;
bool allAliveAreLovers = true;
for (int aliveIndex = 0; aliveIndex < aapc.Count; aliveIndex++)
if (Main.LoversPlayers.Count > 0 && CustomRoles.Lovers.IsEnable())
{
bool found = false;
int id = aapc[aliveIndex].PlayerId;
for (int loverIndex = 0; loverIndex < Main.LoversPlayers.Count; loverIndex++)
bool allAliveAreLovers = true;
for (int aliveIndex = 0; aliveIndex < aapc.Count; aliveIndex++)
{
if (Main.LoversPlayers[loverIndex].PlayerId == id)
bool found = false;
int id = aapc[aliveIndex].PlayerId;
for (int loverIndex = 0; loverIndex < Main.LoversPlayers.Count; loverIndex++)
{
found = true;
if (Main.LoversPlayers[loverIndex].PlayerId == id)
{
found = true;
break;
}
}
if (!found)
{
allAliveAreLovers = false;
break;
}
}
if (!found)
if (allAliveAreLovers)
{
allAliveAreLovers = false;
break;
}
}
if (allAliveAreLovers)
{
bool allCrew = true;
for (int loverIndex = 0; loverIndex < Main.LoversPlayers.Count; loverIndex++)
{
if (!Main.LoversPlayers[loverIndex].Is(Team.Crewmate))
bool allCrew = true;
for (int loverIndex = 0; loverIndex < Main.LoversPlayers.Count; loverIndex++)
{
allCrew = false;
break;
if (!Main.LoversPlayers[loverIndex].Is(Team.Crewmate))
{
allCrew = false;
break;
}
}
}
if (!allCrew || !Lovers.CrewLoversWinWithCrew.GetBool())
{
ResetAndSetWinner(CustomWinner.Lovers);
for (int i = 0; i < Main.LoversPlayers.Count; i++)
WinnerIds.Add(Main.LoversPlayers[i].PlayerId);
if (!allCrew || !Lovers.CrewLoversWinWithCrew.GetBool())
{
ResetAndSetWinner(CustomWinner.Lovers);
for (int i = 0; i < Main.LoversPlayers.Count; i++)
WinnerIds.Add(Main.LoversPlayers[i].PlayerId);
return true;
return true;
}
}
}
+1 -1
View File
@@ -168,7 +168,7 @@ internal static class ChangeRoleSettings
RoleTypes.Viper
}.Do(x => Main.NormalOptions.roleOptions.SetRoleRate(x, 0, 0));
if (Main.NormalOptions.MapId > 5 && !(Main.NormalOptions.MapId == 6 && SubmergedCompatibility.Loaded))
if (Main.NormalOptions.MapId > 5 && !(Main.NormalOptions.MapId == 6 && SubmergedCompatibility.Loaded) && !Main.LIMap)
{
Logger.SendInGame(GetString("UnsupportedMap"), Color.red);
ErrorText.Instance.AddError(ErrorCode.UnsupportedMap);