mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 22:59:27 +00:00
fix: fix panic
This commit is contained in:
parent
d9f8d3cd0b
commit
3589991609
1 changed files with 5 additions and 4 deletions
|
@ -73,13 +73,14 @@ pub(crate) fn calcul_donated_time(
|
||||||
}
|
}
|
||||||
|
|
||||||
let manual_amount = lock!(gui_api_xvb).stats_priv.runtime_manual_amount as u32;
|
let manual_amount = lock!(gui_api_xvb).stats_priv.runtime_manual_amount as u32;
|
||||||
if lock!(gui_api_xvb).stats_priv.runtime_mode == RuntimeMode::ManuallyDonante || avg_hr > 0.0 {
|
let avg_hr = avg_hr as u32;
|
||||||
spared_time = XVB_TIME_ALGO * manual_amount / (avg_hr as u32);
|
if lock!(gui_api_xvb).stats_priv.runtime_mode == RuntimeMode::ManuallyDonante && avg_hr > 0 {
|
||||||
|
spared_time = XVB_TIME_ALGO * manual_amount / avg_hr;
|
||||||
info!("spared_time = 600 * {manual_amount} / {avg_hr} = {spared_time}")
|
info!("spared_time = 600 * {manual_amount} / {avg_hr} = {spared_time}")
|
||||||
}
|
}
|
||||||
|
|
||||||
if lock!(gui_api_xvb).stats_priv.runtime_mode == RuntimeMode::ManuallyKeep || avg_hr > 0.0 {
|
if lock!(gui_api_xvb).stats_priv.runtime_mode == RuntimeMode::ManuallyKeep && avg_hr > 0 {
|
||||||
spared_time = XVB_TIME_ALGO - (XVB_TIME_ALGO * manual_amount / (avg_hr as u32));
|
spared_time = XVB_TIME_ALGO - (XVB_TIME_ALGO * manual_amount / avg_hr);
|
||||||
info!("spared_time = 600 * {manual_amount} / {avg_hr} = {spared_time}")
|
info!("spared_time = 600 * {manual_amount} / {avg_hr} = {spared_time}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue