mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 11:11:10 +02:00
Treat headless cache reads as misses in CacheFs
The modkit validate and pack drivers run the real loader under plain luajit, with no love global. With --base imported, Data:load falls back to CacheFs.readActive for a generated module require cannot find (an optional module like data/generated/audio.lua is legitimately absent from developer and stale caches), and CacheFs.read indexed love.filesystem once there was no portable root, so validate and pack died with MK100 before the mod was even looked at. Headless there is no save directory to read from, so return nil like any other cache miss. Refs #850
This commit is contained in:
@@ -294,6 +294,9 @@ function CacheFs.read(rel)
|
||||
f:close()
|
||||
return data
|
||||
end
|
||||
-- headless (plain luajit, e.g. the modkit validate/pack driver): there is
|
||||
-- no save directory to read from, so a cache miss is nil, not a crash
|
||||
if not (love and love.filesystem) then return nil end
|
||||
return love.filesystem.read(rel)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user