MCPcopy Create free account
hub / github.com/DFHack/dfhack / getAvailableItemsByHeat

Function getAvailableItemsByHeat

plugins/buildingplan/buildingplan.cpp:724–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

722}
723
724static int getAvailableItemsByHeat(lua_State *L) {
725 color_ostream *out = Lua::GetOutput(L);
726 if (!out)
727 out = &Core::getInstance().getConsole();
728 df::building_type type = (df::building_type)luaL_checkint(L, 1);
729 int16_t subtype = luaL_checkint(L, 2);
730 int32_t custom = luaL_checkint(L, 3);
731 int index = luaL_checkint(L, 4);
732 HeatSafety heat = (HeatSafety)luaL_checkint(L, 5);
733 DEBUG(control,*out).print(
734 "entering getAvailableItemsByHeat building_type={} subtype={} custom={} index={} heat={}\n",
735 ENUM_AS_STR(type), subtype, custom, index, static_cast<int>(heat));
736 vector<int> item_ids;
737 scanAvailableItems(*out, type, subtype, custom, index, true, true, &heat, &item_ids);
738 Lua::PushVector(L, item_ids);
739 return 1;
740}
741
742static int getGlobalSettings(lua_State *L) {
743 color_ostream *out = Lua::GetOutput(L);

Callers

nothing calls this directly

Calls 3

scanAvailableItemsFunction · 0.85
PushVectorFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected