Skip to content

[Chapter 66] Wrong JSON data makes the game crash #229

Open
@PierreGuyot

Description

@PierreGuyot

```json
"spells" : [
{
"name" : "Zap",
"effects" : {
"ranged" : "6",
"damage" : "5",
"particle_line" : "▓;#00FFFF;200.0"
}
}
]
```

At that point, mana_cost is declared as mandatory on the Spell struct in spell_structs.rs.
Since there is no mana_cost field in the JSON file, the game crashes on start when loading the JSON data.
The final state of the code for this chapter does include this mana_cost field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions