fix: Fixes missing ordinal string comparisons arguments. (#1431)

---------

Co-authored-by: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
This commit is contained in:
mdodkins 2023-07-24 04:12:38 +01:00 • committed by GitHub
parent 8eb480bdf5
commit d366e02251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View file

@ -81,7 +81,7 @@ public class GumpGrid : Gump
} }
//percent //percent
var percent = sizes[i].Replace("*", ""); var percent = sizes[i].RemoveOrdinal("*");
var size = sizes[i] != percent ? len / 100 * int.Parse(percent) : int.Parse(percent); var size = sizes[i] != percent ? len / 100 * int.Parse(percent) : int.Parse(percent);
list.Add(new Swap { Index = i, Size = size }); list.Add(new Swap { Index = i, Size = size });

View file

@ -530,7 +530,7 @@ public static class Core
#if DEBUG #if DEBUG
const bool idleCPU = true; const bool idleCPU = true;
#else #else
var idleCPU = ServerConfiguration.GetOrUpdateSetting("core.enableIdleCPU", false); var idleCPU = ServerConfiguration.GetOrUpdateSetting("core.enableIdleCPU", false);
#endif #endif
long last = TickCount; long last = TickCount;

View file

@ -401,7 +401,7 @@ public class SkillInfo
DexGain = dexGain; DexGain = dexGain;
IntGain = intGain; IntGain = intGain;
GainFactor = gainFactor; GainFactor = gainFactor;
ProfessionSkillName = professionSkillName ?? Name.Replace(" ", ""); ProfessionSkillName = professionSkillName ?? Name.RemoveOrdinal(" ");
StatTotal = strScale + dexScale + intScale; StatTotal = strScale + dexScale + intScale;
} }

View file

@ -84,7 +84,7 @@ public static class AssistantHandler
// Instead we are supporting razor community edition. // Instead we are supporting razor community edition.
var assistVersion = reader.ReadAscii(); var assistVersion = reader.ReadAscii();
state.Assistant = assistVersion.Contains(' ') ? assistVersion : $"RazorCE {assistVersion}"; state.Assistant = assistVersion.ContainsOrdinal(' ') ? assistVersion : $"RazorCE {assistVersion}";
} }
private static void HandshakeResponse(NetState state, CircularBufferReader reader, int packetLength) private static void HandshakeResponse(NetState state, CircularBufferReader reader, int packetLength)

View file

@ -15,7 +15,7 @@ namespace Server
return true; return true;
} }
var lowerName = name?.ToLowerInvariant().Replace(" ", ""); var lowerName = name?.ToLowerInvariant().RemoveOrdinal(" ");
if (!string.IsNullOrEmpty(lowerName)) if (!string.IsNullOrEmpty(lowerName))
{ {

View file

@ -394,7 +394,7 @@ namespace Server.Saves
if (files) if (files)
{ {
var fileName = new FileInfo(item).Name; var fileName = new FileInfo(item).Name;
name = fileName[..fileName.IndexOf('.')]; name = fileName[..fileName.IndexOfOrdinal('.')];
} }
else else
{ {