changeset 260:9d98bac0b1d9

fix: wrong path-checking
author Sam <sam@basx.dev>
date Thu, 25 May 2023 15:57:58 +0700
parents 772d8af8f126
children dca9900a9da2
files src/semicongine/resources.nim
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/semicongine/resources.nim	Wed May 24 23:31:05 2023 +0700
+++ b/src/semicongine/resources.nim	Thu May 25 15:57:58 2023 +0700
@@ -33,9 +33,10 @@
     joinPath(resourceRoot(), selectedMod)
 
   proc loadResource_intern(path: string): Stream =
-    if not path.fileExists():
+    let realpath = joinPath(modRoot(), path)
+    if not realpath.fileExists():
       raise newException(Exception, &"Resource {path} not found")
-    newFileStream(joinPath(modRoot(), path), fmRead)
+    newFileStream(realpath, fmRead)
 
   proc modList_intern(): seq[string] =
     for kind, file in walkDir(resourceRoot(), relative=true):