From 20c98e9b48e920803c9b2dbd2ef45745786d49a0 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 15 May 2019 00:21:08 -0400 Subject: [PATCH] Add sim.CELL constant + some other change I made a while ago for some reason --- src/lua/LegacyLuaAPI.cpp | 2 +- src/lua/LuaScriptInterface.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lua/LegacyLuaAPI.cpp b/src/lua/LegacyLuaAPI.cpp index 3d61fb8c4..26d6c68d2 100644 --- a/src/lua/LegacyLuaAPI.cpp +++ b/src/lua/LegacyLuaAPI.cpp @@ -1369,7 +1369,7 @@ int luatpt_getscript(lua_State* l) return luaL_error(l, http::StatusText(ret).ToUtf8().c_str()); } - if (!strcmp(scriptData.c_str(), "Invalid script ID\r\n")) + if (scriptData.Contains("Invalid script ID")) { return luaL_error(l, "Invalid Script ID"); } diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index bd0d8dccc..830872dc3 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -789,6 +789,7 @@ void LuaScriptInterface::initSimulationAPI() //Static values SETCONST(l, XRES); SETCONST(l, YRES); + SETCONST(l, CELL); SETCONST(l, PT_NUM); lua_pushinteger(l, 0); lua_setfield(l, -2, "NUM_PARTS"); SETCONST(l, R_TEMP);