| 98 | } |
| 99 | |
| 100 | static 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 |
no test coverage detected