added null check to PlayerBase.move()
This commit is contained in:
parent
a1f5c55f41
commit
9753fa2931
@ -33,9 +33,13 @@ public class PlayerBase implements Destroyable {
|
|||||||
public void move(Direction direction) {
|
public void move(Direction direction) {
|
||||||
this.setFacingDirection(direction);
|
this.setFacingDirection(direction);
|
||||||
Tile tile = this.getCurrentTile().getAdjacentTile(direction);
|
Tile tile = this.getCurrentTile().getAdjacentTile(direction);
|
||||||
|
|
||||||
|
if (tile != null)
|
||||||
|
{
|
||||||
tile.onEntry(this);
|
tile.onEntry(this);
|
||||||
setCurrentTile(tile);
|
setCurrentTile(tile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void pickZPM(Tile tile) { /* PlayerBase does not collect ZPM modules */ }
|
public void pickZPM(Tile tile) { /* PlayerBase does not collect ZPM modules */ }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user