Archived
1
0

-Added checking to validate moves

Signed-off-by: Tony Grosinger <tony@grosinger.net>
This commit is contained in:
Tony Grosinger 2011-09-13 15:32:23 -07:00
parent a5e5999b4d
commit dd89b54fc3
2 changed files with 7 additions and 1 deletions

View File

@ -592,7 +592,13 @@ public class DroneListItem {
break; break;
} }
} }
// TODO - validate that the move is a valid location
if (getX() + amountE > Nomads.awesomeWorld.getWorldSize() - 1
|| getX() + amountE < 0
|| getY() + amountN > Nomads.awesomeWorld.getWorldSize() - 1
|| getY() + amountN < 0) {
return;
}
// Check to see if there is a MoneyPile or Objective there // Check to see if there is a MoneyPile or Objective there
GameObject objectHere = Nomads.awesomeWorld.getObjectAt(getX() GameObject objectHere = Nomads.awesomeWorld.getObjectAt(getX()