Adjusted the lua's map API, requiring a large rewrite

One the whole nothing major has changed, but I think this makes things
more logical. I just hope its stable, since I'm releasing a new tag.
This commit is contained in:
Kayne Ruse
2014-04-29 15:52:07 +10:00
parent 2b8e7241c9
commit 92fc9b4e25
8 changed files with 190 additions and 129 deletions
+4 -4
View File
@@ -39,8 +39,8 @@ void LuaFormat::Load(Region** const ptr, int x, int y) {
}
//API hook
lua_getglobal(state, "Region");
lua_getfield(state, -1, "Load");
lua_getglobal(state, "map");
lua_getfield(state, -1, "load");
lua_pushlightuserdata(state, *ptr);
lua_pushstring(state, saveDir.c_str());
if (lua_pcall(state, 2, 1, 0) != LUA_OK) {
@@ -55,8 +55,8 @@ void LuaFormat::Load(Region** const ptr, int x, int y) {
void LuaFormat::Save(Region* const ptr) {
//API hook
lua_getglobal(state, "Region");
lua_getfield(state, -1, "Save");
lua_getglobal(state, "map");
lua_getfield(state, -1, "save");
lua_pushlightuserdata(state, ptr);
lua_pushstring(state, saveDir.c_str());
if (lua_pcall(state, 2, 0, 0) != LUA_OK) {