mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-09-01 03:19:18 +02:00
Accept .exe binary name on Linux/macOS and fix AlwaysOn battery threshold
build-macos.sh ships the macOS binary as eu07.exe, so IsValidBinaryFile must accept that extension on non-Windows too. Also fix the AlwaysOn battery default check to use a proper near-zero epsilon instead of an overly broad <0.2 threshold that clobbered legitimate low velocities. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -256,8 +256,10 @@ public sealed class Settings
|
|||||||
return false;
|
return false;
|
||||||
if (OperatingSystem.IsWindows())
|
if (OperatingSystem.IsWindows())
|
||||||
return ext == ".exe";
|
return ext == ".exe";
|
||||||
// Linux / macOS: no extension (eu07) or a known binary suffix
|
// Linux / macOS: no extension (eu07), a known binary suffix, or .exe
|
||||||
return ext.Length == 0 || ext is ".x86_64" or ".run" or ".appimage";
|
// (some builds - notably this project's own build-macos.sh - ship the
|
||||||
|
// macOS binary under the historical "eu07.exe" name).
|
||||||
|
return ext.Length == 0 || ext is ".exe" or ".x86_64" or ".run" or ".appimage";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly Encoding FileEncoding = ResolveEncoding();
|
private static readonly Encoding FileEncoding = ResolveEncoding();
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public partial class MainWindow : Window
|
|||||||
trainset.Velocity = Settings.Instance.BatteryDefault switch
|
trainset.Velocity = Settings.Instance.BatteryDefault switch
|
||||||
{
|
{
|
||||||
BatteryDefault.AlwaysOff => 0f,
|
BatteryDefault.AlwaysOff => 0f,
|
||||||
BatteryDefault.AlwaysOn => trainset.OriginalVelocity < 0.2f ? 0.1f : trainset.OriginalVelocity,
|
BatteryDefault.AlwaysOn => MathF.Abs(trainset.OriginalVelocity) < 0.01f ? 0.1f : trainset.OriginalVelocity,
|
||||||
_ => trainset.OriginalVelocity
|
_ => trainset.OriginalVelocity
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user