From 0a020dbcc848ae2debec664846e08bd097d70320 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 23 Oct 2012 20:03:06 +0300 Subject: Properly read the mesh from LUA. Players can now be set to meshes using the following test script: function switch_player_visual() prop = { mesh="player.obj", texture="player.png", visual="mesh", } for _, obj in pairs(minetest.get_connected_players()) do obj:set_properties(prop) end minetest.after(1.0, switch_player_visual) end minetest.after(1.0, switch_player_visual) --- src/scriptapi.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 09900ce1f..7eda636e3 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -936,6 +936,9 @@ static void read_object_properties(lua_State *L, int index, lua_pop(L, 1); getstringfield(L, -1, "visual", prop->visual); + + getstringfield(L, -1, "mesh", prop->mesh); + getstringfield(L, -1, "texture", prop->texture); lua_getfield(L, -1, "visual_size"); if(lua_istable(L, -1)) -- cgit v1.2.3