Conversation
Don't have prices change on each skill change. Save die rolls.
Dice used to be rerolled for everything on every change. Now they are rerolled only when they have to be so you can raise and lower e.g. broker skill and get the same result.
If there isn't a specific selling world, make it so the origin is used. Its a faster use of the UI in some cases. But we want to make this clear to the user what we're doing.
Seems most of what we are storing we want to keep across browser restarts.
🤖 Augment PR SummarySummary: Refactors the Trade Computer flow to reduce unnecessary RNG rerolls and persist state across browser restarts. Changes:
Technical Notes: Persistence keys remain at 🤖 Was this summary useful? React with 👍 or 👎 |
| debug!("price_to_sell_rng: No trade classes provided, clearing sell price for {}", self.name); | ||
| self.sell_price = None; | ||
| self.sell_price_comment.clear(); | ||
| self.sell_price_comment = "NOTHING TO SEE HERE".to_string(); |
There was a problem hiding this comment.
| player_broker_skill: i32, | ||
| ) { | ||
| // Save the existing freight lots with their size rolls | ||
| let saved_lots = passengers.freight_lots.clone(); |
There was a problem hiding this comment.
saved_lots is cloned from freight_lots, but freight_lots is sorted by size during generation; reusing size_roll sequentially can therefore shift rolls between Major/Minor/Incidental lots (different multipliers) and change sizes without re-rolling. That seems to undermine the goal of recalculating freight “using saved rolls” and can affect freight revenue.
🤖 Was this useful? React with 👍 or 👎
| ); | ||
| }); | ||
|
|
||
| // Recalculate passengers and freight using saved rolls |
There was a problem hiding this comment.
Refactors on how the app is used. Make dice reroll only when necessary and preserve data across browser restarts.