roblox_emulator: shove tick into task module
This commit is contained in:
parent
d8358ec25c
commit
b507624d91
@ -2,6 +2,9 @@
|
|||||||
fn no_op(_lua:&mlua::Lua,_time:Option<super::number::Number>)->mlua::Result<f64>{
|
fn no_op(_lua:&mlua::Lua,_time:Option<super::number::Number>)->mlua::Result<f64>{
|
||||||
Ok(0.0)
|
Ok(0.0)
|
||||||
}
|
}
|
||||||
|
fn tick(_lua:&mlua::Lua,_:())->mlua::Result<f64>{
|
||||||
|
Ok(0.0)
|
||||||
|
}
|
||||||
// This is used to avoid calling coroutine.yield from the rust side.
|
// This is used to avoid calling coroutine.yield from the rust side.
|
||||||
const LUA_WAIT:&str=
|
const LUA_WAIT:&str=
|
||||||
"local coroutine_yield=coroutine.yield
|
"local coroutine_yield=coroutine.yield
|
||||||
@ -31,5 +34,9 @@ pub fn set_globals(lua:&mlua::Lua,globals:&mlua::Table)->Result<(),mlua::Error>{
|
|||||||
|
|
||||||
globals.raw_set("wait",wait)?;
|
globals.raw_set("wait",wait)?;
|
||||||
|
|
||||||
|
// TODO: move this somewhere it belongs
|
||||||
|
let tick=lua.create_function(tick)?;
|
||||||
|
globals.raw_set("tick",tick)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user