Minor MovementDiagonal cleanup

This commit is contained in:
Brady 2018-08-29 18:59:22 -05:00
parent 51593a95e4
commit 1734caeed8
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 2 additions and 8 deletions

View File

@ -106,18 +106,12 @@ public class MovementDiagonal extends Movement {
return COST_INF;
}
if (optionA == 0) {
if (MovementHelper.avoidWalkingInto(pb2.getBlock())) {
return COST_INF;
}
if (MovementHelper.avoidWalkingInto(pb3.getBlock())) {
if (MovementHelper.avoidWalkingInto(pb2.getBlock()) || MovementHelper.avoidWalkingInto(pb3.getBlock())) {
return COST_INF;
}
}
if (optionB == 0) {
if (MovementHelper.avoidWalkingInto(pb0.getBlock())) {
return COST_INF;
}
if (MovementHelper.avoidWalkingInto(pb1.getBlock())) {
if (MovementHelper.avoidWalkingInto(pb0.getBlock()) || MovementHelper.avoidWalkingInto(pb1.getBlock())) {
return COST_INF;
}
}