mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
added check to stop nullpointexception
This commit is contained in:
parent
4fe0439297
commit
13730dd592
@ -167,7 +167,7 @@ public class Board {
|
||||
if(robots.containsKey(robotID)){
|
||||
robots.get(robotID).setPowerDown(powerDown);
|
||||
}
|
||||
else {
|
||||
else if (getRobotFromDeadRobots(robotID)!=null) {
|
||||
getRobotFromDeadRobots(robotID).setPowerDown(powerDown);
|
||||
}
|
||||
}
|
||||
@ -184,9 +184,10 @@ public class Board {
|
||||
if(robots.containsKey(robotID)){
|
||||
return robots.get(robotID).isInPowerDown();
|
||||
}
|
||||
else {
|
||||
else if (getRobotFromDeadRobots(robotID)!=null){
|
||||
return getRobotFromDeadRobots(robotID).isInPowerDown();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
private Robot getRobotFromDeadRobots(RobotID robotID){
|
||||
for (Robot robot:deadRobots) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user