1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Reshape LuaEntityCAO implementation a bit and make TNT to blink

This commit is contained in:
Perttu Ahola 2011-11-26 12:35:30 +02:00
parent 1ce749c86a
commit 70363847aa
6 changed files with 373 additions and 307 deletions

View file

@ -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}
};