aboutsummaryrefslogtreecommitdiff
path: root/src/script/common/c_converter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/common/c_converter.h')
-rw-r--r--src/script/common/c_converter.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/script/common/c_converter.h b/src/script/common/c_converter.h
index a14eb9186..2af726d16 100644
--- a/src/script/common/c_converter.h
+++ b/src/script/common/c_converter.h
@@ -61,23 +61,10 @@ bool getintfield(lua_State *L, int table,
return got;
}
-template<class T>
-bool getv3intfield(lua_State *L, int index,
- const char *fieldname, T &result)
-{
- lua_getfield(L, index, fieldname);
- bool got = false;
- if (lua_istable(L, -1)) {
- got |= getintfield(L, -1, "x", result.X);
- got |= getintfield(L, -1, "y", result.Y);
- got |= getintfield(L, -1, "z", result.Z);
- }
- lua_pop(L, 1);
- return got;
-}
-
+// Retrieve an v3s16 where all components are optional (falls back to default)
v3s16 getv3s16field_default(lua_State *L, int table,
const char *fieldname, v3s16 default_);
+
bool getstringfield(lua_State *L, int table,
const char *fieldname, std::string &result);
size_t getstringlistfield(lua_State *L, int table,
@@ -100,6 +87,7 @@ void setboolfield(lua_State *L, int table,
const char *fieldname, bool value);
v3f checkFloatPos (lua_State *L, int index);
+v2f check_v2f (lua_State *L, int index);
v3f check_v3f (lua_State *L, int index);
v3s16 check_v3s16 (lua_State *L, int index);