Fix warnings and code cleanup/fixes (#13570)

This commit is contained in:
Visne
2023-01-19 03:56:45 +01:00
committed by GitHub
parent 3ca5a0224b
commit c6d3e4f3bd
265 changed files with 499 additions and 666 deletions

View File

@@ -1,3 +1,4 @@
using System.Globalization;
using System.Linq;
using Content.Server.Actions;
using Content.Server.Chat.Managers;
@@ -77,9 +78,9 @@ public sealed class ZombieRuleSystem : GameRuleSystem
else if (percent <= 0.25)
ev.AddLine(Loc.GetString("zombie-round-end-amount-low"));
else if (percent <= 0.5)
ev.AddLine(Loc.GetString("zombie-round-end-amount-medium", ("percent", Math.Round((percent * 100), 2).ToString())));
ev.AddLine(Loc.GetString("zombie-round-end-amount-medium", ("percent", Math.Round((percent * 100), 2).ToString(CultureInfo.InvariantCulture))));
else if (percent < 1)
ev.AddLine(Loc.GetString("zombie-round-end-amount-high", ("percent", Math.Round((percent * 100), 2).ToString())));
ev.AddLine(Loc.GetString("zombie-round-end-amount-high", ("percent", Math.Round((percent * 100), 2).ToString(CultureInfo.InvariantCulture))));
else
ev.AddLine(Loc.GetString("zombie-round-end-amount-all"));
@@ -174,7 +175,6 @@ public sealed class ZombieRuleSystem : GameRuleSystem
{
_chatManager.DispatchServerAnnouncement(Loc.GetString("zombie-no-one-ready"));
ev.Cancel();
return;
}
}
@@ -216,7 +216,7 @@ public sealed class ZombieRuleSystem : GameRuleSystem
livingHumans.Add(mob.Owner);
}
}
return ((float) livingZombies.Count) / (float) totalPlayers.Count;
return livingZombies.Count / (float) totalPlayers.Count;
}
/// <summary>