else if (max < 5 && (
                terrain.get(x + 1, y) === TERRAIN_MASK_SWAMP
                || terrain.get(x, y + 1) === TERRAIN_MASK_SWAMP
                || terrain.get(x + 1, y + 1) === TERRAIN_MASK_SWAMP
            )) {