Deals damage to any unit in the target square, potentially destroying it.
(&mut self, location: MapLocation, damage: i32)
| 1067 | |
| 1068 | /// Deals damage to any unit in the target square, potentially destroying it. |
| 1069 | fn damage_location(&mut self, location: MapLocation, damage: i32) { |
| 1070 | let id = if let Some(id) = self.my_planet().units_by_loc.get(&location) { |
| 1071 | *id |
| 1072 | } else { |
| 1073 | return; |
| 1074 | }; |
| 1075 | |
| 1076 | self.damage_unit(id, damage) |
| 1077 | } |
| 1078 | |
| 1079 | /// * NoSuchUnit - the unit does not exist (inside the vision range). |
| 1080 | /// * TeamNotAllowed - the unit is not on the current player's team. |
no test coverage detected