fix bl.schedule errors

This commit is contained in:
Redo
2025-10-02 14:35:03 -05:00
parent de9992aa2c
commit fe9ee3cc2b
5 changed files with 9 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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.

View File

@@ -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