mantis 9159: ignore spaces in z on cast string to vector

This commit is contained in:
UbitUmarov
2024-09-03 21:40:10 +01:00
parent 4a72e92a74
commit 565cb7bdcf
2 changed files with 38 additions and 1 deletions

View File

@@ -1099,14 +1099,18 @@ namespace OpenSim.Framework
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsWindows()
{
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
/*
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
*/
}
public static bool LoadArchSpecificWindowsDll(string libraryName)
@@ -3100,6 +3104,39 @@ namespace OpenSim.Framework
return false;
}
[DllImport("winmm.dll")]
private static extern uint timeBeginPeriod(uint period);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void TimeBeginPeriod(uint period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeBeginPeriod(period);
}
[DllImport("winmm.dll")]
private static extern uint timeEndPeriod(uint period);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void TimeEndPeriod(uint period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeEndPeriod(period);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void ThreadSleep(int period)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
timeEndPeriod(1);
Thread.Sleep(period);
timeEndPeriod(1);
}
else
Thread.Sleep(period);
}
/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>

View File

@@ -154,7 +154,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
while (++comma < str.Length)
{
c = Unsafe.Add(ref MemoryMarshal.GetReference(str), comma);
if (c == ' ' || c == '>')
if (c == '>')
break;
}