if (isValidDisplacement(game, entityId, src, dest)) {
if (isValidDisplacement(game, entityId, src, dest) && game.board.contains(dest)) {
    public static Coords getPreferredDisplacement(Game game, int entityId,                                              Coords src, int direction) {        final Entity entity = game.getEntity(entityId);        int highestElev = Integer.MIN_VALUE;        Coords highest = null;        // check the surrounding hexes, nearest to the original direction first        int[] offsets = {0, 1, 5, 2, 4, 3};        for (int i = 0; i < offsets.length; i++) {            Coords dest = src.translated((direction + offsets[i]) % 6);            if (isValidDisplacement(game, entityId, src, dest)) {                 // assume that if the displacement's valid, hex is !null                Hex hex = game.board.getHex(dest);                int elevation = entity.elevationOccupied(hex);                if (elevation > highestElev) {                    highestElev = elevation;                    highest = dest;                }            }        }        return highest;    }