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

Function has_contaminant

plugins/add-spatter.cpp:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static int has_contaminant(df::item_actual *item, int type, int index)
101{
102 auto cont = item->contaminants;
103 if (!cont)
104 return 0;
105
106 int size = 0;
107
108 for (size_t i = 0; i < cont->size(); i++)
109 {
110 auto cur = (*cont)[i];
111 if (cur->base.mat_type == type && cur->base.mat_index == index)
112 size += cur->base.size;
113 }
114
115 return size;
116}
117
118/*
119 * Hooks

Callers 1

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected