Skip to content

Issue with parsing bbox coords in elevation code #375

@benjamin051000

Description

@benjamin051000

While working on #374 , I found this issue in the elevation code:

arnis/src/ground.rs

Lines 130 to 133 in a969d65

let coords: Vec<f64> = bbox_str
.split_whitespace()
.map(|s: &str| s.parse::<f64>())
.collect::<Result<Vec<f64>, _>>()?;

Here, split_whitespace is the wrong method to call. In CLI mode, it fails, leading the elevation code to be skipped.

Does the GUI pass the bbox coords in with space delimiters? The CLI breaks unless you use comma delimiters.

We should settle on one way to do this, or even better, replace the bbox string with an actual struct so we don't have to parse it in worldgen logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions