From c294275da4b1cdab172c598f94ed572e0354d5df Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 23 Sep 2023 14:47:04 +0900 Subject: [PATCH] bugfix: not working reousrce.load --- src/DotRecast.Core/RcResources.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DotRecast.Core/RcResources.cs b/src/DotRecast.Core/RcResources.cs index 5e63c9d..2b33f7c 100644 --- a/src/DotRecast.Core/RcResources.cs +++ b/src/DotRecast.Core/RcResources.cs @@ -6,7 +6,12 @@ namespace DotRecast.Core { public static byte[] Load(string filename) { - var filepath = RcDirectory.SearchFile($"resources/{filename}"); + var filepath = filename; + if (!File.Exists(filepath)) + { + filepath = RcDirectory.SearchFile($"resources/{filename}"); + } + using var fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read); byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length);