From 5facacaf206cd6553b5cc39fbbac57dc3ceda9f7 Mon Sep 17 00:00:00 2001 From: William Venner Date: Tue, 4 Jan 2022 21:56:40 +0000 Subject: [PATCH] Fix incorrect stack indexes --- gmod/src/lua/lua_state.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmod/src/lua/lua_state.rs b/gmod/src/lua/lua_state.rs index 713955f..8e9cc85 100644 --- a/gmod/src/lua/lua_state.rs +++ b/gmod/src/lua/lua_state.rs @@ -572,13 +572,13 @@ impl LuaState { }, "boolean" => { self.push_value(index); - let boolean = self.get_boolean(index); + let boolean = self.get_boolean(-1); self.pop(); format!("{}", boolean) }, "number" => { self.push_value(index); - let n = self.to_number(index); + let n = self.to_number(-1); self.pop(); format!("{}", n) },