diff --git a/BlockLua-Unsafe.dll b/BlockLua-Unsafe.dll index 740e540..e6c29ca 100644 Binary files a/BlockLua-Unsafe.dll and b/BlockLua-Unsafe.dll differ diff --git a/BlockLua.dll b/BlockLua.dll index f160fba..2752df3 100644 Binary files a/BlockLua.dll and b/BlockLua.dll differ diff --git a/inc/lua/lua5.1.lib b/inc/lua/lua5.1.lib deleted file mode 100644 index 1b8d57c..0000000 Binary files a/inc/lua/lua5.1.lib and /dev/null differ diff --git a/readme.md b/readme.md index ceea7f1..db88072 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,8 @@ # BlockLua + +Lua scripting for Blockland + ## How to Install - Install RedBlocklandLoader - Copy `lua5.1.dll` into your Blockland install folder, next to `Blockland.exe` @@ -64,10 +67,12 @@ Relative paths (`./`) are allowed. `..` is not allowed. `file:write(string)` - Write an opened file (must be opened in 'w' (write), 'a' (append), 'wb' or 'ab' mode) `file:close()` - Close an opened file Reading files from ZIPs is supported, with caveats. Null characters are not allowed, and \r\n becomes \n. Generally, text formats work, and binary formats don't. +When reading from outside ZIPs, binary files are fully supported. ### Modules and Dependencies `dofile('Add-Ons/Path/file.lua')` - Execute a Lua file. Relative paths (`./file.lua`) are allowed. `..` is not allowed. -`require('modulePath.moduleName')` - Load a Lua file or or external library. + +`require('modulePath.moduleName')` - Load a Lua file or or external library. Require replaces `.` with `/` in the path, and then searches for files in the following order: - `./modulePath/moduleName.lua` - `./modulePath/moduleName/init.lua` @@ -76,7 +81,8 @@ Require replaces `.` with `/` in the path, and then searches for files in the fo - `modules/lualib/modulePath/moduleName.lua` - `modules/lualib/modulePath/moduleName/init.lua` - `modules/lualib/modulePath/moduleName.dll` -Like in standard Lua, modules loaded using `require` are only executed the first time `require` is called with that path. Subsequent calls simply return the result from the initial execution. To allow hot reloading, use `dofile`. + +Like in standard Lua, modules loaded using `require` are only executed the first time `require` is called with that path. Subsequent calls simply return the result from the initial execution. To allow hot reloading, use `dofile`. ## Type Conversion When a TorqueScript function is called from Lua or vice-versa, the arguments and return value must be converted between the two languages' type systems. diff --git a/src/util/libbl.lua b/src/util/libbl.lua index 4670399..0078a1d 100644 --- a/src/util/libbl.lua +++ b/src/util/libbl.lua @@ -538,7 +538,7 @@ function _bllua_schedule_callback(id) id = tonumber(id) local sch = bl._scheduleTable[id] if not sch then error('_ts_schedule_callback: no schedule with id '..id) end - bl._scheduleTable[sched_id] = nil + bl._scheduleTable[id] = nil sch.callback(unpack(sch.args)) end