summaryrefslogtreecommitdiff
path: root/library/LuaApi.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-06-19 18:48:22 +0400
committerAlexander Gavrilov2012-06-19 18:48:22 +0400
commit50bd758876adb8a39c54f107af9a5bd2274a3638 (patch)
tree0038040453e5a53056201f0a6e6e7128c9cb2c4e /library/LuaApi.cpp
parent50dff568994a79feaa465b03da9e251ef87c0798 (diff)
downloaddfhack-50bd758876adb8a39c54f107af9a5bd2274a3638.tar.gz
dfhack-50bd758876adb8a39c54f107af9a5bd2274a3638.tar.bz2
dfhack-50bd758876adb8a39c54f107af9a5bd2274a3638.tar.xz
Replace dfhack.internal.getBase with getRebaseDelta.
Also, when printing found offsets, subtract the delta.
Diffstat (limited to 'library/LuaApi.cpp')
-rw-r--r--library/LuaApi.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp
index 631b3c49..3693070d 100644
--- a/library/LuaApi.cpp
+++ b/library/LuaApi.cpp
@@ -1036,10 +1036,10 @@ static void *checkaddr(lua_State *L, int idx, bool allow_null = false)
return rv;
}
-static uint32_t getBase() { return Core::getInstance().p->getBase(); }
+static uint32_t getRebaseDelta() { return Core::getInstance().vinfo->getRebaseDelta(); }
static const LuaWrapper::FunctionReg dfhack_internal_module[] = {
- WRAP(getBase),
+ WRAP(getRebaseDelta),
{ NULL, NULL }
};
@@ -1074,6 +1074,7 @@ static int internal_setAddress(lua_State *L)
}
// Print via printerr, so that it is definitely logged to stderr.log.
+ addr -= Core::getInstance().vinfo->getRebaseDelta();
std::string msg = stl_sprintf("<global-address name='%s' value='0x%x'/>", name.c_str(), addr);
dfhack_printerr(L, msg);