From a6a1e6ed1a8de1294970a5af6ba992c38d4022b8 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 11 Nov 2011 20:50:09 +0200 Subject: random scripting work-in-progress --- src/scriptapi.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/scriptapi.cpp') diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index fbe383075..d055c1976 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -77,24 +77,25 @@ static void realitycheck(lua_State *L) } // Register new object prototype (must be based on entity) -static int l_register_object(lua_State *L) +static int l_register_entity(lua_State *L) { const char *name = luaL_checkstring(L, 1); luaL_checkany(L, 2); - infostream<<"register_object: "<getId()); // Push id + lua_pushnumber(L, id); // Push id lua_pushnil(L); lua_settable(L, objectstable); @@ -340,7 +342,7 @@ void scriptapi_luaentity_step(lua_State *L, u16 id, { realitycheck(L); assert(lua_checkstack(L, 20)); - infostream<<"scriptapi_luaentity_step: id="<getId()); // Push id + lua_pushnumber(L, id); // Push id lua_gettable(L, objectstable); // TODO: Call step function -- cgit v1.2.3