From ab3675d6eea1ce6eeeac713ed44f5cb591ff820f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 14 May 2013 18:11:04 -0400 Subject: [PATCH] minor lua api fixes --- src/cat/LegacyLuaAPI.cpp | 2 ++ src/cat/LuaScriptInterface.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cat/LegacyLuaAPI.cpp b/src/cat/LegacyLuaAPI.cpp index 7eed0625d..7be9db75f 100644 --- a/src/cat/LegacyLuaAPI.cpp +++ b/src/cat/LegacyLuaAPI.cpp @@ -1838,6 +1838,8 @@ int luatpt_heat(lua_State* l) int luatpt_cmode_set(lua_State* l) { int cmode = luaL_optint(l, 1, 0)+1; + if (cmode == 11) + cmode = 0; if (cmode >= 0 && cmode <= 10) luacon_controller->LoadRenderPreset(cmode); else diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 15f2defb6..17928ef06 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -1017,9 +1017,9 @@ int LuaScriptInterface::simulation_createWalls(lua_State * l) { int x = luaL_optint(l,1,-1); int y = luaL_optint(l,2,-1); - int rx = luaL_optint(l,3,5); - int ry = luaL_optint(l,4,5); - int c = luaL_optint(l,5,-1); + int rx = luaL_optint(l,3,0); + int ry = luaL_optint(l,4,0); + int c = luaL_optint(l,5,8); //int flags = luaL_optint(l,6,get_brush_flags()); if (x < 0 || x > XRES || y < 0 || y > YRES) return luaL_error(l, "Coordinates out of range (%d,%d)", x, y); @@ -1037,9 +1037,9 @@ int LuaScriptInterface::simulation_createWallLine(lua_State * l) int y1 = luaL_optint(l,2,-1); int x2 = luaL_optint(l,3,-1); int y2 = luaL_optint(l,4,-1); - int rx = luaL_optint(l,5,5); - int ry = luaL_optint(l,6,5); - int c = luaL_optint(l,7,-1); + int rx = luaL_optint(l,5,0); + int ry = luaL_optint(l,6,0); + int c = luaL_optint(l,7,8); //int flags = luaL_optint(l,8,get_brush_flags()); if (x1 < 0 || x1 > XRES || y1 < 0 || y1 > YRES) return luaL_error(l, "Starting coordinates out of range (%d,%d)", x1, y1); @@ -1058,7 +1058,7 @@ int LuaScriptInterface::simulation_createWallBox(lua_State * l) int y1 = luaL_optint(l,2,-1); int x2 = luaL_optint(l,3,-1); int y2 = luaL_optint(l,4,-1); - int c = luaL_optint(l,5,luacon_model->GetActiveTool(0)->GetToolID()); + int c = luaL_optint(l,5,8); //int flags = luaL_optint(l,6,get_brush_flags()); if (x1 < 0 || x1 > XRES || y1 < 0 || y1 > YRES) return luaL_error(l, "Starting coordinates out of range (%d,%d)", x1, y1); @@ -1075,7 +1075,7 @@ int LuaScriptInterface::simulation_floodWalls(lua_State * l) { int x = luaL_optint(l,1,-1); int y = luaL_optint(l,2,-1); - int c = luaL_optint(l,3,luacon_model->GetActiveTool(0)->GetToolID()); + int c = luaL_optint(l,3,8); int cm = luaL_optint(l,4,-1); int bm = luaL_optint(l,5,-1); //int flags = luaL_optint(l,6,0);