From 8e5f391d3a015e918d017b5bcbe5a61573f2f82a Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sat, 15 Feb 2020 02:42:44 -0600 Subject: [PATCH] attempt to fix lua calls in check-structures-sanity --- plugins/devel/check-structures-sanity.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/devel/check-structures-sanity.cpp b/plugins/devel/check-structures-sanity.cpp index c458a4564..9f1c3a346 100644 --- a/plugins/devel/check-structures-sanity.cpp +++ b/plugins/devel/check-structures-sanity.cpp @@ -148,8 +148,8 @@ static command_result command(color_ostream & out, std::vector & pa using namespace DFHack::LuaWrapper; StackUnwinder unwinder(State); - Push(parameters.at(0)); PushModulePublic(out, "utils", "df_expr_to_ref"); + Push(parameters.at(0)); if (!SafeCall(out, 1, 1)) { return CR_FAILURE; @@ -158,7 +158,9 @@ static command_result command(color_ostream & out, std::vector & pa ToCheck ref; ref.path.push_back(parameters.at(0)); ref.ptr = get_object_ref(State, -1); - ref.identity = get_object_identity(State, -1, "check-structures-sanity command argument", false, false); + lua_getfield(State, -1, "_type"); + lua_getfield(State, -1, "_identity"); + ref.identity = reinterpret_cast(lua_touserdata(State, -1)); if (!ref.identity) { return CR_FAILURE;