mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-17 11:11:10 +02:00
fix(switch): unhide fused save-dir generated cache on Play
PhysFS does not merge archive data/ with save-dir data/generated, so fused NX Play crashed after import. Prepend-mount generated trees, fall back to CacheFs.read in Data:load, keep multiline lua-error logs, and skip Boot.run when network is unvalidated. T24 stays open. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+13
-1
@@ -196,7 +196,19 @@ local function loadModule(dir, name)
|
||||
if not chunk then return false, err end
|
||||
return pcall(chunk)
|
||||
end
|
||||
return pcall(require, "data.generated." .. name)
|
||||
local ok, mod = pcall(require, "data.generated." .. name)
|
||||
if ok then return true, mod end
|
||||
-- Fused PhysFS may hide save-dir data/generated behind the archive's
|
||||
-- data/ tree even after mountVersion; load bytes explicitly as fallback.
|
||||
local CacheFs = require("src.import.CacheFs")
|
||||
local path = "data/generated/" .. name .. ".lua"
|
||||
local bytes = CacheFs.read(path)
|
||||
if type(bytes) == "string" then
|
||||
local chunk, err = loadstring(bytes, "@" .. path)
|
||||
if not chunk then return false, err or mod end
|
||||
return pcall(chunk)
|
||||
end
|
||||
return false, mod
|
||||
end
|
||||
|
||||
function Data:load()
|
||||
|
||||
Reference in New Issue
Block a user