mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Fix start, join, formatting, and locale issues
This commit is contained in:
@@ -8,8 +8,18 @@ local _require = require
|
||||
-- This replace function is used to avoid additional lines in stack traces during control stage
|
||||
local function replace()
|
||||
require = function(path)
|
||||
--- @cast path string
|
||||
if package.lifecycle == package.lifecycle_stage.runtime then
|
||||
return loaded[path] or loaded[path:gsub(".", "/")] or error("Can only require files at runtime that have been required in the control stage.", 2)
|
||||
local replaced = path:gsub("%.", "/")
|
||||
if not replaced:match("^__(.-)__") then
|
||||
replaced = "__level__/" .. replaced
|
||||
end
|
||||
if not replaced:match(".lua$") then
|
||||
replaced = replaced .. ".lua"
|
||||
end
|
||||
return loaded[path]
|
||||
or loaded[replaced]
|
||||
or error("Can only require files at runtime that have been required in the control stage.", 2)
|
||||
else
|
||||
return _require(path)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user