Skip to content

Commit 33839c1

Browse files
committed
fixes
1 parent d0b361b commit 33839c1

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Intersect.Client.Core/Core/Graphics.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,13 @@ public static void InitInGame()
160160

161161
public static void DrawIntro()
162162
{
163-
if (!sContentManager.TryGetTexture(
164-
TextureType.Image,
165-
ClientConfiguration.Instance.IntroImages[Globals.IntroIndex],
166-
out var texture
167-
))
163+
var introImages = ClientConfiguration.Instance.IntroImages;
164+
if (introImages.Count <= Globals.IntroIndex)
165+
{
166+
return;
167+
}
168+
169+
if (!sContentManager.TryGetTexture(TextureType.Image, introImages[Globals.IntroIndex], out var texture))
168170
{
169171
return;
170172
}

Intersect.Client.Core/MonoGame/IntersectGame.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ private IntersectGame(IClientContext context, Action postStartupAction)
9595
args.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount = 8;
9696
};
9797

98-
Content.RootDirectory = string.Empty;
98+
var workingDirectory = context.StartupOptions.WorkingDirectory ?? string.Empty;
99+
var resolvedWorkingDirectory = Path.GetFullPath(workingDirectory, Environment.CurrentDirectory);
100+
Content.RootDirectory = resolvedWorkingDirectory;
99101
IsMouseVisible = true;
100102
Globals.ContentManager = new MonoContentManager();
101103
Globals.Database = new JsonDatabase();

Intersect.Client.Framework/ClientCommandLineOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public partial record ClientCommandLineOptions : ICommandLineOptions
1616
public int ScreenHeight { get; init; }
1717

1818
[Option('S', "server", Default = null, Required = false)]
19-
public string Server { get; init; }
19+
public string? Server { get; init; }
2020

2121
[Option("working-directory", Default = null, Required = false)]
22-
public string WorkingDirectory { get; init; }
22+
public string? WorkingDirectory { get; init; }
2323

2424
[Option('p', "plugin-directory", Default = null, Required = false)]
2525
public IEnumerable<string>? PluginDirectories { get; init; }

0 commit comments

Comments
 (0)