-
-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Don't rerandomise a script's settings when loading from a save #8051
Conversation
This is making random deviation for start_date to not occur anymore |
That's not what I'm seeing. Where are you expecting start_date to be randomised? Some debug prints from when I started the AI:
This no longer occurs on load, but I have no idea why you'd want it to change then? |
I mean, random deviation for start_date, has to happen on constructor on new game. |
Note that a start_date of 0 means no deviation should occur to start_date. The following table assumes start_date != 0
These are the expected behaviours (unless I'm mistaken somewhere, this is quite confusing indeed) |
I think the issue here is that start_date needs to be treated separately to all the other (random) settings. Currently there are just a load of hacks that either call AddRandomDeviation too early, just for the purposes of setting start_date, or a load of code that undoes what AddRandomDeviation does to start_date just so it can be maintained properly. |
Yeah I see the core issue as start_date being a parameter that logically belongs to OpenTTD rather than the AI script. It shouldn't be part of the same list of configuration settings when it doesn't belong to the AI script and follows different rules. |
In that case, #7661 is a rework of start_date. |
ScriptConfig stuff is all pretty hairy, but I'm pretty sure this is what's wanted. Besides, Samu's AfterFix AI is literally the only one on BaNaNaS that makes use of the random settings anyway.
Closes #7486