`loadfile` in Lua
A loadfile implementation for SRB2.
Lua scripters:
-
loadfileexists now, and it's basicallydofile, but instead of calling the file immediately, the file is returned as a function for you to do stuff with, like sending it arguments and doingsetfenvshenanigans.
C people:
-
LUA_DoLumpreplaces the oldLUA_LoadLump;LUA_LoadLumpdoesloadfilestuff now. -
LUA_DoLump(and by extensiondofile) is now implemented internally as the equivalent ofloadfile("filename.lua")()
Here's a cool PK3 that self-tests itself. It will check for basically every case I've thought of so far.
loadfile.pk3
Edited by Golden