Unstable v0.19.3.0

This commit is contained in:
Juan Pablo Arce
2022-09-02 15:10:56 -03:00
parent 28789616bd
commit 3f2c843247
336 changed files with 7152 additions and 7739 deletions
@@ -3,13 +3,12 @@ using Barotrauma.Networking;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Barotrauma.IO;
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Runtime.CompilerServices;
namespace Barotrauma
{
@@ -161,7 +160,7 @@ namespace Barotrauma
public static string RemoveInvalidFileNameChars(string fileName)
{
var invalidChars = Path.GetInvalidFileNameChars().Concat(new char[] {':', ';', '<', '>', '"', '/', '\\', '|', '?', '*'});
var invalidChars = Path.GetInvalidFileNameCharsCrossPlatform().Concat(new char[] {';'});
foreach (char invalidChar in invalidChars)
{
fileName = fileName.Replace(invalidChar.ToString(), "");
@@ -424,7 +423,7 @@ namespace Barotrauma
for (int i = 0; i < numberOfBits; i++)
{
bool bit = originalBuffer.ReadBoolean();
buffer.Write(bit);
buffer.WriteBoolean(bit);
}
buffer.BitPosition = 0;
@@ -713,9 +712,14 @@ namespace Barotrauma
return e;
}
public static void ThrowIfNull<T>(T o)
public static void ThrowIfNull<T>([NotNull] T o)
{
if (o is null) { throw new ArgumentNullException(); }
}
public static string GetFormattedPercentage(float v)
{
return TextManager.GetWithVariable("percentageformat", "[value]", ((int)MathF.Round(v * 100)).ToString()).Value;
}
}
}