some fixes

This commit is contained in:
Gurge44 committed 2026-03-09 09:58:11 +01:00
1 parent b2d57793aa
commit 55f18c7951
19 files changed
+58 -37

No files matched your search

@@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using AmongUs.GameOptions;
using EHR.Roles;
@@ -276,6 +277,10 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
case CustomGameMode.Standard:
{
President.OnAnyoneApplyGameOptions(opt);
float playerSpeed = Main.AllPlayerSpeed.GetValueOrDefault(player.PlayerId);
bool frozen = Mathf.Approximately(playerSpeed, Main.MinSpeed);
bool inverted = playerSpeed < 0f;
foreach (CustomRoles subRole in state.SubRoles)
{
@@ -292,19 +297,19 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
opt.SetBool(BoolOptionNames.AnonymousVotes, false);
break;
}
case CustomRoles.Flash:
case CustomRoles.Flash when !frozen:
{
Main.AllPlayerSpeed[player.PlayerId] = Options.FlashSpeed.GetFloat();
Main.AllPlayerSpeed[player.PlayerId] = inverted ? -Options.FlashSpeed.GetFloat() : Options.FlashSpeed.GetFloat();
break;
}
case CustomRoles.Giant:
case CustomRoles.Giant when !frozen:
{
Main.AllPlayerSpeed[player.PlayerId] = Options.GiantSpeed.GetFloat();
Main.AllPlayerSpeed[player.PlayerId] = inverted ? -Options.GiantSpeed.GetFloat() : Options.GiantSpeed.GetFloat();
break;
}
case CustomRoles.Mare when Options.MareHasIncreasedSpeed.GetBool():
case CustomRoles.Mare when !frozen && Options.MareHasIncreasedSpeed.GetBool():
{
Main.AllPlayerSpeed[player.PlayerId] = Options.MareSpeedDuringLightsOut.GetFloat();
Main.AllPlayerSpeed[player.PlayerId] = inverted ? -Options.MareSpeedDuringLightsOut.GetFloat() : Options.MareSpeedDuringLightsOut.GetFloat();
break;
}
case CustomRoles.Sleep when player.IsAlive() && Utils.IsActive(SystemTypes.Electrical):