| 2098 | } |
| 2099 | |
| 2100 | static bool get_int_field(lua_State *L, int idx, const char *name, int16_t *dest) { |
| 2101 | lua_getfield(L, idx, name); |
| 2102 | if (lua_isnil(L, -1)) { |
| 2103 | lua_pop(L, 1); |
| 2104 | return false; |
| 2105 | } |
| 2106 | *dest = lua_tointeger(L, -1); |
| 2107 | lua_pop(L, 1); |
| 2108 | return true; |
| 2109 | } |
| 2110 | |
| 2111 | static bool get_bounds(lua_State *L, int idx, df::coord &pos1, df::coord &pos2) { |
| 2112 | return get_int_field(L, idx, "x1", &pos1.x) && |
no test coverage detected