diff --git a/src/AcDream.App/Program.cs b/src/AcDream.App/Program.cs index c876cf1..10b3a6b 100644 --- a/src/AcDream.App/Program.cs +++ b/src/AcDream.App/Program.cs @@ -40,11 +40,14 @@ foreach (var result in PluginDiscovery.Scan(pluginsDir)) Log.Information("loaded plugin {Id} ({DisplayName})", result.Manifest!.Id, result.Manifest.DisplayName); } -foreach (var plugin in loaded) - plugin.Plugin!.Enable(); - try { + foreach (var plugin in loaded) + { + try { plugin.Plugin!.Enable(); } + catch (Exception ex) { Log.Error(ex, "plugin enable failed: {Id}", plugin.Manifest.Id); } + } + using var window = new GameWindow(datDir); window.Run(); } diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 1c395c9..59a4bb2 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -91,7 +91,10 @@ public sealed class GameWindow : IDisposable _dats = new DatCollection(_datDir, DatAccessType.Read); // Find ANY landblock ending in 0xFFFF. Holtburg 0xA9B4FFFF is a - // good default; fall back to the first one we find. + // good default; fall back to the first one we find. Using Get + // (returns null on miss) rather than TryGet to sidestep + // [MaybeNullWhen(false)] nullable-generic analysis under + // TreatWarningsAsErrors. uint landblockId = 0xA9B4FFFFu; var block = _dats.Get(landblockId); if (block is null)