aboutsummaryrefslogtreecommitdiff
path: root/src/scriptapi.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-12 10:39:44 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:39 +0200
commitdcedfdacd1ba77591cdc0aa2b8c123c6a5ef2f5d (patch)
treeb52f1ec55269db3c0691e0292de4d1bb64f41389 /src/scriptapi.h
parentea8d6d7abd86b33169b8c2b80cd382d82ba84b8b (diff)
downloadminetest-dcedfdacd1ba77591cdc0aa2b8c123c6a5ef2f5d.tar.gz
minetest-dcedfdacd1ba77591cdc0aa2b8c123c6a5ef2f5d.tar.bz2
minetest-dcedfdacd1ba77591cdc0aa2b8c123c6a5ef2f5d.zip
Scripting WIP
Diffstat (limited to 'src/scriptapi.h')
-rw-r--r--src/scriptapi.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/scriptapi.h b/src/scriptapi.h
index 891342fa3..2a5eb25a9 100644
--- a/src/scriptapi.h
+++ b/src/scriptapi.h
@@ -27,6 +27,7 @@ class Server;
class ServerEnvironment;
class ServerActiveObject;
typedef struct lua_State lua_State;
+struct LuaEntityProperties;
void scriptapi_export(lua_State *L, Server *server);
void scriptapi_add_environment(lua_State *L, ServerEnvironment *env);
@@ -34,34 +35,12 @@ void scriptapi_add_environment(lua_State *L, ServerEnvironment *env);
void scriptapi_add_object_reference(lua_State *L, ServerActiveObject *cobj);
void scriptapi_rm_object_reference(lua_State *L, ServerActiveObject *cobj);
-struct LuaEntityProperties
-{
- bool physical;
- float weight;
- core::aabbox3d<f32> boundingbox;
- std::string visual;
- core::list<std::string> textures;
-
- LuaEntityProperties():
- physical(true),
- weight(5),
- boundingbox(-0.5,-0.5,-0.5, 0.5,0.5,0.5),
- visual("cube")
- {
- textures.push_back("unknown_block.png");
- textures.push_back("unknown_block.png");
- textures.push_back("unknown_block.png");
- textures.push_back("unknown_block.png");
- textures.push_back("unknown_block.png");
- textures.push_back("unknown_block.png");
- }
-};
-
void scriptapi_luaentity_add(lua_State *L, u16 id, const char *name,
const char *init_state);
void scriptapi_luaentity_rm(lua_State *L, u16 id);
std::string scriptapi_luaentity_get_state(lua_State *L, u16 id);
-LuaEntityProperties scriptapi_luaentity_get_properties(lua_State *L, u16 id);
+void scriptapi_luaentity_get_properties(lua_State *L, u16 id,
+ LuaEntityProperties *prop);
void scriptapi_luaentity_step(lua_State *L, u16 id, float dtime);
void scriptapi_luaentity_rightclick_player(lua_State *L, u16 id,
const char *playername);