Skip to content

Commit

Permalink
fix reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
jupyterkat committed Nov 5, 2023
1 parent 518801b commit 9bf661d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/reaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,26 @@ impl Reaction {
min_gas_reqs.push((i, req_amount));
}
}
let min_temp_req = min_reqs.read_number("TEMP").ok();
let max_temp_req = min_reqs.read_number("MAX_TEMP").ok();
let min_ener_req = min_reqs.read_number("ENER").ok();
let min_fire_req = min_reqs.read_number("FIRE_REAGENTS").ok();
let min_temp_req = min_reqs
.read_list_index("TEMP")
.ok()
.map(|item| item.get_number().ok())
.flatten();
let max_temp_req = min_reqs
.read_list_index("MAX_TEMP")
.ok()
.map(|item| item.get_number().ok())
.flatten();
let min_ener_req = min_reqs
.read_list_index("ENER")
.ok()
.map(|item| item.get_number().ok())
.flatten();
let min_fire_req = min_reqs
.read_list_index("FIRE_REAGENTS")
.ok()
.map(|item| item.get_number().ok())
.flatten();
Ok(Reaction {
id,
priority,
Expand Down

0 comments on commit 9bf661d

Please sign in to comment.