Prøver å fjerne exception produsert fordi vi endrer en liste som vi looper igjennom

This commit is contained in:
Kristian Knarvik 2020-04-28 12:42:49 +02:00
parent 6d6d4e70bf
commit 6d0c1a719f

View File

@ -8,6 +8,7 @@ import inf112.fiasko.roborally.elementproperties.TileType;
import inf112.fiasko.roborally.elementproperties.WallType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -761,7 +762,8 @@ public class Board {
* Kills all robots that have taken too much damage
*/
private void killAllHeavilyDamagedRobots() {
for (Robot robot : robots.values()) {
Collection<Robot> robotList = robots.values();
for (Robot robot : robotList) {
if (robot.getDamageTaken() >= 10) {
killRobot(robot);
}