v1.0.0.5: Fix crash when map texture path is invalid (ArgumentOutOfRangeException in Lumina GetFileHash)
Made-with: Cursor
This commit is contained in:
@@ -214,7 +214,7 @@ public unsafe partial class MapRenderer : IDisposable
|
||||
// Markers are drawn from whatever the game has already populated (e.g. after opening the map once).
|
||||
|
||||
// When the game has the current map loaded (area map open or just closed), update our cache for this map.
|
||||
if (agent->SelectedMapId == currentMapId && agent->SelectedMapPath.Length > 0) {
|
||||
if (agent->SelectedMapId == currentMapId && agent->SelectedMapPath.Length > 0 && agent->SelectedMapBgPath.Length > 0) {
|
||||
var bgPath = $"{agent->SelectedMapBgPath}.tex";
|
||||
var fgPath = $"{agent->SelectedMapPath}.tex";
|
||||
var pathKey = bgPath + "|" + fgPath;
|
||||
@@ -346,13 +346,23 @@ public unsafe partial class MapRenderer : IDisposable
|
||||
|
||||
private static TexFile? GetTexFile(string rawPath)
|
||||
{
|
||||
var path = Service.TextureSubstitutionProvider.GetSubstitutedPath(rawPath);
|
||||
|
||||
if (Path.IsPathRooted(path)) {
|
||||
return Service.DataManager.GameData.GetFileFromDisk<TexFile>(path);
|
||||
if (string.IsNullOrWhiteSpace(rawPath)) return null;
|
||||
string path;
|
||||
try {
|
||||
path = Service.TextureSubstitutionProvider.GetSubstitutedPath(rawPath);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(path)) return null;
|
||||
|
||||
return Service.DataManager.GetFile<TexFile>(path);
|
||||
try {
|
||||
if (Path.IsPathRooted(path)) {
|
||||
return Service.DataManager.GameData.GetFileFromDisk<TexFile>(path);
|
||||
}
|
||||
return Service.DataManager.GetFile<TexFile>(path);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawMapMarkers()
|
||||
|
||||
Reference in New Issue
Block a user