| 705 | } |
| 706 | |
| 707 | static int getAvailableItems(lua_State *L) { |
| 708 | color_ostream *out = Lua::GetOutput(L); |
| 709 | if (!out) |
| 710 | out = &Core::getInstance().getConsole(); |
| 711 | df::building_type type = (df::building_type)luaL_checkint(L, 1); |
| 712 | int16_t subtype = luaL_checkint(L, 2); |
| 713 | int32_t custom = luaL_checkint(L, 3); |
| 714 | int index = luaL_checkint(L, 4); |
| 715 | DEBUG(control,*out).print( |
| 716 | "entering getAvailableItems building_type={} subtype={} custom={} index={}\n", |
| 717 | ENUM_AS_STR(type), subtype, custom, index); |
| 718 | vector<int> item_ids; |
| 719 | scanAvailableItems(*out, type, subtype, custom, index, true, false, NULL, &item_ids); |
| 720 | Lua::PushVector(L, item_ids); |
| 721 | return 1; |
| 722 | } |
| 723 | |
| 724 | static int getAvailableItemsByHeat(lua_State *L) { |
| 725 | color_ostream *out = Lua::GetOutput(L); |
nothing calls this directly
no test coverage detected