| 168 | } |
| 169 | |
| 170 | command_result spotclean (color_ostream &out, vector <string> & parameters) |
| 171 | { |
| 172 | if (cursor->x < 0) |
| 173 | { |
| 174 | out.printerr("The cursor is not active.\n"); |
| 175 | return CR_WRONG_USAGE; |
| 176 | } |
| 177 | if (!Maps::IsValid()) |
| 178 | { |
| 179 | out.printerr("Map is not available.\n"); |
| 180 | return CR_FAILURE; |
| 181 | } |
| 182 | df::map_block *block = Maps::getTileBlock(cursor->x, cursor->y, cursor->z); |
| 183 | if (block == NULL) |
| 184 | { |
| 185 | out.printerr("Invalid map block selected!\n"); |
| 186 | return CR_FAILURE; |
| 187 | } |
| 188 | |
| 189 | for (auto evt : block->block_events) |
| 190 | { |
| 191 | if (evt->getType() != block_square_event_type::material_spatter) |
| 192 | continue; |
| 193 | // type verified - recast to subclass |
| 194 | df::block_square_event_material_spatterst *spatter = (df::block_square_event_material_spatterst *)evt; |
| 195 | clean_mud_safely(spatter, block->map_pos, df::coord(cursor->x % 16, cursor->y % 16, 0)); |
| 196 | } |
| 197 | return CR_OK; |
| 198 | } |
| 199 | |
| 200 | command_result clean (color_ostream &out, vector <string> & parameters) |
| 201 | { |
nothing calls this directly
no test coverage detected