From b5d40a49f8ba767da222ca7a832dadf7ac8a98e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Wed, 25 Oct 2023 15:17:29 +0200 Subject: [PATCH] Remove luajit ffi particle access No point to having it sit around effectively commented out. --- src/lua/LuaScriptInterface.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 8251f8990..0124e952c 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -424,22 +424,6 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m): lua_setfield(l, tptProperties, "version"); lua_sethook(l, &luacon_hook, LUA_MASKCOUNT, 200); -#ifdef FFI - //LuaJIT's ffi gives us direct access to parts data, no need for nested metatables. HOWEVER, this is in no way safe, it's entirely possible for someone to try to read parts[-10] - lua_pushlightuserdata(l, parts); - lua_setfield(l, tptProperties, "partsdata"); - - tpt_lua_dostring (l, "ffi = require(\"ffi\")\n\ -ffi.cdef[[\n\ -typedef struct { int type; int life, ctype; float x, y, vx, vy; float temp; int tmp3; int tmp4; int flags; int tmp; int tmp2; unsigned int dcolour; } particle;\n\ -]]\n\ -tpt.parts = ffi.cast(\"particle *\", tpt.partsdata)\n\ -ffi = nil\n\ -tpt.partsdata = nil"); - //Since ffi is REALLY REALLY dangrous, we'll remove it from the environment completely (TODO) - //lua_pushliteral(l, "parts"); - //tptPartsCData = lua_gettable(l, tptProperties); -#else lua_newtable(l); tptParts = lua_gettop(l); lua_newtable(l); @@ -466,7 +450,6 @@ tpt.partsdata = nil"); tptPart = new LuaSmartRef(); tptPart->Assign(l, -1); lua_pop(l, 1); -#endif lua_newtable(l); tptElements = lua_gettop(l);