diff --git a/world/src/sim2/mod.rs b/world/src/sim2/mod.rs index 01c31fd7c5..8e761b62ec 100644 --- a/world/src/sim2/mod.rs +++ b/world/src/sim2/mod.rs @@ -581,7 +581,6 @@ fn trade_at_site( } else { debug!("bought {:?} {} {}", *g, paid_amount, *price); } - good_delivery[*g] += paid_amount; if economy.stocks[*g] - paid_amount < 0.0 { info!( "BUG {:?} {:?} {} TO {:?} OSR {:?} ND {:?}", @@ -592,8 +591,9 @@ fn trade_at_site( order_stock_ratio, next_demand[*g] ); + paid_amount = economy.stocks[*g]; } - assert!(economy.stocks[*g] - paid_amount >= 0.0); + good_delivery[*g] += paid_amount; economy.stocks[*g] -= paid_amount; } }