From 70363847aacbf765c60a294940ba50c8bb256cc6 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 26 Nov 2011 12:35:30 +0200 Subject: Reshape LuaEntityCAO implementation a bit and make TNT to blink --- src/scriptapi.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index af6e1779f..badf38181 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -1252,6 +1252,18 @@ private: return 1; } + // settexturemod(self, mod) + static int l_settexturemod(lua_State *L) + { + ObjectRef *ref = checkobject(L, 1); + LuaEntitySAO *co = getluaobject(ref); + if(co == NULL) return 0; + // Do it + std::string mod = lua_tostring(L, 2); + co->setTextureMod(mod); + return 0; + } + public: ObjectRef(ServerActiveObject *object): m_object(object) @@ -1322,6 +1334,7 @@ const luaL_reg ObjectRef::methods[] = { method(ObjectRef, setvelocity), method(ObjectRef, setacceleration), method(ObjectRef, add_to_inventory), + method(ObjectRef, settexturemod), {0,0} }; -- cgit v1.2.3