| 128 | } |
| 129 | |
| 130 | command_result cleanunits (color_ostream &out) |
| 131 | { |
| 132 | // Invoked from clean(), already suspended |
| 133 | int cleaned_units = 0, cleaned_total = 0; |
| 134 | for (auto unit : world->units.active) |
| 135 | { |
| 136 | if (unit->body.spatters.size()) |
| 137 | { |
| 138 | for (size_t j = 0; j < unit->body.spatters.size(); j++) |
| 139 | delete unit->body.spatters[j]; |
| 140 | cleaned_units++; |
| 141 | cleaned_total += unit->body.spatters.size(); |
| 142 | unit->body.spatters.clear(); |
| 143 | } |
| 144 | } |
| 145 | if (cleaned_total) |
| 146 | out.print("Removed {} contaminants from {} creatures.\n", cleaned_total, cleaned_units); |
| 147 | return CR_OK; |
| 148 | } |
| 149 | |
| 150 | command_result cleanplants (color_ostream &out) |
| 151 | { |