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

Function logistics_setStockpileConfig

plugins/logistics.cpp:754–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752}
753
754static void logistics_setStockpileConfig(color_ostream& out, int stockpile_number,
755 bool melt, bool trade,
756 bool dump, bool train,
757 int forbid, bool melt_masterworks) {
758 DEBUG(control, out).print("entering logistics_setStockpileConfig\n");
759 DEBUG(control, out).print("stockpile_number={}, melt={}, trade={}, dump={}, train={}, forbid={}, melt_masterworks={}\n",
760 stockpile_number, melt, trade, dump, train, forbid, melt_masterworks);
761
762 if (!find_stockpile(stockpile_number)) {
763 out.printerr("invalid stockpile number: {}\n", stockpile_number);
764 return;
765 }
766
767 auto &c = ensure_stockpile_config(out, stockpile_number);
768 c.set_bool(STOCKPILE_CONFIG_MELT, melt);
769 c.set_bool(STOCKPILE_CONFIG_MELT_MASTERWORKS, melt_masterworks);
770 c.set_bool(STOCKPILE_CONFIG_TRADE, trade);
771 c.set_bool(STOCKPILE_CONFIG_DUMP, dump);
772 c.set_bool(STOCKPILE_CONFIG_TRAIN, train);
773 c.set_int(STOCKPILE_CONFIG_FORBID, forbid);
774}
775
776static int logistics_clearStockpileConfig(lua_State *L) {
777 color_ostream *out = Lua::GetOutput(L);

Callers

nothing calls this directly

Calls 2

find_stockpileFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected