Skip to content

Commit

Permalink
154: Fix resource calculation for labs cards
Browse files Browse the repository at this point in the history
  • Loading branch information
angel-git committed May 12, 2024
1 parent 6d96f74 commit 4d52619
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src-tauri/src/ui_profile/ui_profile_serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,15 @@ fn parse_items(
// max_resource = Some(udp.repairable.as_ref().unwrap().max_durability);
}
if udp.key.is_some() {
resource = Some(
bsg_item._props.maximum_number_of_usages.unwrap()
- udp.key.as_ref().unwrap().number_of_usages,
);
let bsg_maximum_number_of_usages = bsg_item._props.maximum_number_of_usages.unwrap();
if bsg_maximum_number_of_usages == 0 {
resource = Some(1);
} else {
resource = Some(
bsg_maximum_number_of_usages
- udp.key.as_ref().unwrap().number_of_usages,
);
};
}
}
}
Expand Down

0 comments on commit 4d52619

Please sign in to comment.