| 2306 | } |
| 2307 | |
| 2308 | static int units_isUnitInBox(lua_State *state) { |
| 2309 | auto u = Lua::CheckDFObject<df::unit>(state, 1); |
| 2310 | if (lua_gettop(state) > 3) { |
| 2311 | int x1 = luaL_checkint(state, 2); |
| 2312 | int y1 = luaL_checkint(state, 3); |
| 2313 | int z1 = luaL_checkint(state, 4); |
| 2314 | int x2 = luaL_checkint(state, 5); |
| 2315 | int y2 = luaL_checkint(state, 6); |
| 2316 | int z2 = luaL_checkint(state, 7); |
| 2317 | lua_pushboolean(state, Units::isUnitInBox(u, x1, y1, z1, x2, y2, z2)); |
| 2318 | } |
| 2319 | else { |
| 2320 | df::coord pos1, pos2; |
| 2321 | Lua::CheckDFAssign(state, &pos1, 2); |
| 2322 | Lua::CheckDFAssign(state, &pos2, 3); |
| 2323 | lua_pushboolean(state, Units::isUnitInBox(u, pos1, pos2)); |
| 2324 | } |
| 2325 | return 1; |
| 2326 | } |
| 2327 | |
| 2328 | static int units_getUnitsInBox(lua_State *state) { |
| 2329 | vector<df::unit *> units; |
nothing calls this directly
no test coverage detected