From 2b99d904f6b8197931954772b6466d8ee56cafc9 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sat, 9 May 2015 01:38:20 -0400 Subject: Schematics: Add per-node force placement option --- src/script/common/c_converter.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/script/common/c_converter.cpp') diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp index 157db3b7d..fc489ea95 100644 --- a/src/script/common/c_converter.cpp +++ b/src/script/common/c_converter.cpp @@ -331,6 +331,19 @@ bool getintfield(lua_State *L, int table, return got; } +bool getintfield(lua_State *L, int table, + const char *fieldname, u8 &result) +{ + lua_getfield(L, table, fieldname); + bool got = false; + if(lua_isnumber(L, -1)){ + result = lua_tonumber(L, -1); + got = true; + } + lua_pop(L, 1); + return got; +} + bool getintfield(lua_State *L, int table, const char *fieldname, u16 &result) { -- cgit v1.2.3