Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ dot-writer = { version = "0.1.4", default-features = false }
parking_lot = { version = "0.12.1", default-features = false }
strum = { version = "0.26", default-features = false }
rhai = { version = "1.21", default-features = false }
mlua = { version = "0.10", default-features = false }
mlua = { version = "0.11", default-features = false }
log = { version = "0.4", default-features = false }
env_logger = { version = "0.11", default-features = false }
clap = { version = "4", default-features = false, features = ["std"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ impl FromLua for LuaScriptValue {
Value::Nil => ScriptValue::Unit,
Value::Boolean(b) => ScriptValue::Bool(b),
// Value::LightUserData(light_user_data) => todo!(),
#[cfg(not(feature = "luau"))]
Value::Integer(i) => ScriptValue::Integer(i),
#[cfg(feature = "luau")]
Value::Integer(i) => ScriptValue::Integer(i as i64),
Value::Number(n) => ScriptValue::Float(n),
Value::String(s) => ScriptValue::String(s.to_str()?.to_owned().into()),
Value::Function(f) => ScriptValue::Function(
Expand Down Expand Up @@ -187,10 +184,7 @@ impl IntoLua for LuaScriptValue {
Ok(match self.0 {
ScriptValue::Unit => Value::Nil,
ScriptValue::Bool(b) => Value::Boolean(b),
#[cfg(not(feature = "luau"))]
ScriptValue::Integer(i) => Value::Integer(i),
#[cfg(feature = "luau")]
ScriptValue::Integer(i) => Value::Integer(i as i32),
ScriptValue::Float(f) => Value::Number(f),
ScriptValue::String(s) => Value::String(lua.create_string(s.as_ref())?),
ScriptValue::Reference(r) => LuaReflectReference::from(r).into_lua(lua)?,
Expand All @@ -199,8 +193,8 @@ impl IntoLua for LuaScriptValue {
.create_function(move |lua, args: MultiLuaScriptValue| {
let loc = {
profiling::scope!("function call context");
lua.inspect_stack(1).map(|debug| LocationContext {
line: debug.curr_line().try_into().unwrap_or_default(),
lua.inspect_stack(1, |debug| LocationContext {
line: debug.current_line().unwrap_or_default() as u32,
col: None,
script_name: lua.app_data_ref::<LuaContextAppData>().and_then(|v| {
v.last_loaded_script_name.as_ref().map(|n| n.to_string())
Expand All @@ -221,8 +215,8 @@ impl IntoLua for LuaScriptValue {
.create_function(move |lua, args: MultiLuaScriptValue| {
let loc = {
profiling::scope!("function call context");
lua.inspect_stack(1).map(|debug| LocationContext {
line: debug.curr_line().try_into().unwrap_or_default(),
lua.inspect_stack(1, |debug| LocationContext {
line: debug.current_line().unwrap_or_default() as u32,
col: None,
script_name: lua.app_data_ref::<LuaContextAppData>().and_then(|v| {
v.last_loaded_script_name.as_ref().map(|n| n.to_string())
Expand Down
Loading