added null check to PlayerBase.move()

This commit is contained in:
Kjistóf 2016-05-13 17:23:37 +02:00
parent a1f5c55f41
commit 9753fa2931
1 changed files with 6 additions and 2 deletions

View File

@ -33,8 +33,12 @@ public class PlayerBase implements Destroyable {
public void move(Direction direction) {
this.setFacingDirection(direction);
Tile tile = this.getCurrentTile().getAdjacentTile(direction);
tile.onEntry(this);
setCurrentTile(tile);
if (tile != null)
{
tile.onEntry(this);
setCurrentTile(tile);
}
}
public void pickZPM(Tile tile) { /* PlayerBase does not collect ZPM modules */ }