| 232 | } |
| 233 | |
| 234 | static bool get_int_field(lua_State *L, int idx, const char *name, int16_t *dest) { |
| 235 | lua_getfield(L, idx, name); |
| 236 | if (lua_isnil(L, -1)) { |
| 237 | lua_pop(L, 1); |
| 238 | return false; |
| 239 | } |
| 240 | *dest = lua_tointeger(L, -1); |
| 241 | lua_pop(L, 1); |
| 242 | return true; |
| 243 | } |
| 244 | |
| 245 | static bool get_bounds(lua_State *L, int idx, df::coord &pos1, df::coord &pos2) { |
| 246 | return get_int_field(L, idx, "x1", &pos1.x) && |
no test coverage detected