]> git.lizzy.rs Git - minetest.git/blobdiff - src/scriptapi_types.cpp
Remove no virtual dtor warnings, make MapgenParams contain actual NoiseParams
[minetest.git] / src / scriptapi_types.cpp
index 3d06f1623e6776684eb18825e5f14201e241ce21..f304511080c57c2fda5b7e504a84cf15da265bf0 100644 (file)
@@ -42,6 +42,15 @@ void push_v3f(lua_State *L, v3f p)
        lua_setfield(L, -2, "z");
 }
 
+void push_v2f(lua_State *L, v2f p)
+{
+       lua_newtable(L);
+       lua_pushnumber(L, p.X);
+       lua_setfield(L, -2, "x");
+       lua_pushnumber(L, p.Y);
+       lua_setfield(L, -2, "y");
+}
+
 v2s16 read_v2s16(lua_State *L, int index)
 {
        v2s16 p;
@@ -336,6 +345,13 @@ void setboolfield(lua_State *L, int table,
        lua_setfield(L, table, fieldname);
 }
 
+u32 getflagsfield(lua_State *L, int table,
+               const char *fieldname, FlagDesc *flagdesc) {
+       std::string flagstring;
+       
+       flagstring = getstringfield_default(L, table, fieldname, "");
+       return readFlagString(flagstring, flagdesc);
+}
 
 /* minetest specific types */
 MapNode readnode(lua_State *L, int index, INodeDefManager *ndef)