summaryrefslogtreecommitdiff
path: root/world.fnl
diff options
context:
space:
mode:
authorPhil Hagelberg <phil@hagelb.org>2018-10-31 17:16:15 -0700
committerPhil Hagelberg <phil@hagelb.org>2018-10-31 17:16:15 -0700
commit30fa87ca7f76a21f22638ff4528bbb5cd7495099 (patch)
tree8aeb23d445de5e83776c084cfc69feb6fb07591a /world.fnl
parentce12de2edaa4dbb0d1076e41580b48f6db8631d4 (diff)
Don't assume PWD is the checkout root.
The AppImage version of love2d changes to a temporary directory before running, so you have to explicitly specify the full path; relative paths won't be correct. This won't fix the problem when running from a .love file; in that case you would need to do AOT compilation and include the .lua output inside the archive, but it's a start for folks running from source.
Diffstat (limited to 'world.fnl')
-rw-r--r--world.fnl2
1 files changed, 1 insertions, 1 deletions
diff --git a/world.fnl b/world.fnl
index 947b7bc..d0870ae 100644
--- a/world.fnl
+++ b/world.fnl
@@ -333,7 +333,7 @@
;; error out if either 'maps/${name}.png' or 'maps/${name}.fnl' do not exist.
(fn new-world [name player]
(let [tiles-path (.. "maps/" name ".png")
- meta-path (.. "maps/" name ".fnl")
+ meta-path (.. (love.filesystem.getSource) "/maps/" name ".fnl")
res (load-tiles (love.image.newImageData tiles-path))
res (lume.extend res {:player player})
res (lume.extend res {:slimeballs []})