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

Function find_material

plugins/add-spatter.cpp:75–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static void find_material(int *type, int *index, df::item *input, MaterialSource &mat)
76{
77 if (input && mat.reagent)
78 {
79 MaterialInfo info(input);
80
81 if (mat.product)
82 {
83 if (!info.findProduct(info, mat.product_name))
84 {
85 color_ostream_proxy out(Core::getInstance().getConsole());
86 out.printerr("Cannot find product '{}'\n", mat.product_name);
87 }
88 }
89
90 *type = info.type;
91 *index = info.index;
92 }
93 else
94 {
95 *type = mat.mat_type;
96 *index = mat.mat_index;
97 }
98}
99
100static int has_contaminant(df::item_actual *item, int type, int index)
101{

Callers 2

Calls 1

findProductMethod · 0.80

Tested by

no test coverage detected