-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
Cargo capacity should be recalculated on TRIGGER_VEHICLE_NEW_LOAD #6907
Comments
A workaround for the correct values. Force the train to refit to some other cargo, that is not available on both stations, and back to the required cargo on loading. You will get capacity to be recalculated on refit and always get the right values and graphics. |
Capacity CB code Typical code to choose - (random_bits >> 1) & 0x01 switch (FEAT_TRAINS, SELF, cargo8_container_2_20or40_sprites, (random_bits >> 1) & 0x01) |
A workaround does not work for long train. last wagons of 9 square train become damaged the same way - capacity does not fit the random bits |
To prevent error I've commented the difference in capacity CB. switch (FEAT_TRAINS, SELF, container_2_20or40_cargo_capacity, |
I think the problem here is that the game doesn't like to change the cargo capacity of vehicles when they are not in the depot. This is because is can cause desyncs and is unreliable in certain situations (giving the vehicle more cargo that it can actually take). This is seen if a NewGRF which has been adjusted to give a vehicle in the game a different capacity. This gives an error saying "vehicle xx has had capacity changed. This can harm the game state" or something along those lines. |
The game already allows changing capacity at station with autorefit (outside depot!). |
This issue has been automatically marked as stale because it has not had any activity in the last two months. |
The problem is not fixed in master 27012019 |
Hmm, the trigger is called after the cargo quantity is reserved, as well. |
I might be 100% wrong, but this issue reminds me of autorefit bugs I saw when testing cdist stuff for fonsinchen, which resulted in this fix f790d70#diff-ebbc445f07842947d83d0f98b7fa5140L1568 The comment is interesting, curious if cargo loading reservation causes the autorefit to not happen. |
This issue has been automatically marked as stale because it has not had any activity in the last two months. |
Tested on 1.8.0 stable
I've got serious problem with varying capacity wagons (container platform).
A platform can carry one or two containers, which is defined with TRIGGER_VEHICLE_NEW_LOAD.
The loading speed CB, the capacity CB, graphics are different depending on random_bits.
Loading speed CB and graphics work well, but capacity CB works only once. After the first change it stays unchanged, providing capacity, that is incorrect for the current graphics.
Please force the recalculating of capacity CB after TRIGGER_VEHICLE_NEW_LOAD.
You can test the issue with 11-H004 flatbed http://bundles.openttdcoop.org/xussrset/push/LATEST/
The text was updated successfully, but these errors were encountered: