diff options
Diffstat (limited to 'src/util/mod.rs')
-rw-r--r-- | src/util/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util/mod.rs b/src/util/mod.rs index 67195d5..9831208 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -1043,7 +1043,10 @@ pub(crate) unsafe fn to_string(state: *mut ffi::lua_State, index: c_int) -> Stri let v = ffi::lua_tovector(state, index); mlua_debug_assert!(!v.is_null(), "vector is null"); let (x, y, z) = (*v, *v.add(1), *v.add(2)); - format!("vector({x},{y},{z})") + #[cfg(not(feature = "luau-vector4"))] + return format!("vector({x}, {y}, {z})"); + #[cfg(feature = "luau-vector4")] + return format!("vector({x}, {y}, {z}, {w})", w = *v.add(3)); } ffi::LUA_TSTRING => { let mut size = 0; |