Repository navigation
Conversation
Member
Contributor
Author
Contributor
Author
adriengivry
requested changes
Oct 4, 2026
adriengivry
left a comment
Member
There was a problem hiding this comment.
For this one I still think we should go the require route. We shouldn't treat scripts as resources. require is simple, already implemented, and only requires us to add the project's folder to the search path. Regarding the best way to add the project to the search path, not sure what's the best way to go. What I proposed worked, maybe there is a better, safer way.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Adds
Resources.GetScript(path), which loads a.luaonce and returns whatever the script returns, handing the same instance to every call site.PathParser::GetRealPath, so:resolves against engine assets.GetValidExtensions()._G, and dropped whenReload()destroys the state.Uses
safe_script_file(..., script_pass_on_error, load_mode::text)rather than sol2'srequire_file: Lua is built as C, soSOL_PROPAGATE_EXCEPTIONSis off andrequire_filefails throughlua_error— alongjmpthat cannot be caught and skips C++ destructors. Its cache is also only written after execution, so it cannot detect cycles.The second commit removes
dofile,loadfileandload, which resolved against the executable's working directory and accepted bytecode.Related Issue(s)
Fixes #838
Review Guidance
loadcompiles strings, not files, so nothing here replaces it. The two commits are independent if you would rather take only the first..luarc.jsonkeeps"basic": "enable"sinceprint,pairsand friends come from it.runtime.builtinis per-library, so the LSP still completes the three removed globals.sol::lib::packageon the same lines.GetScriptruns twice and yields two unrelated tables. Intended: Behaviours need per-actor state and their own injectedowner.RemoveBehaviour, which reloads the whole state.Scenes.Loadand the otherResources.Get*do not check containment at all today.Screenshots/GIFs
N/A
AI Usage Disclosure
N/A
Checklist