Skip to content
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

Cost assertion on vehicle refit #4906

Closed
DorpsGek opened this issue Dec 22, 2011 · 9 comments
Closed

Cost assertion on vehicle refit #4906

DorpsGek opened this issue Dec 22, 2011 · 9 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Snail_ opened the ticket and wrote:

Hello,
While I was refitting a vehicle, the game unexpectedly crashes.
Please find attached the crash files I was suggested to post here. If you also need the files of the newGRFs I was using, please let me know.

Hope this helps!

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4906
@DorpsGek
Copy link
Member Author

frosch wrote:

Where can I find this version of the french train set?
French rails grf might be important as well.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10597

@DorpsGek
Copy link
Member Author

Snail_ wrote:

If those are useful to solve the bug, I can give them to you in private (neither set has been released yet). I'll PM them to you through the forums as soon as I can.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10598

@DorpsGek
Copy link
Member Author

frosch wrote:

The bug will be related to the NewGRF and the decisions it makes during refitting. It probably does something which no other GRF does.
Thanks it advance for sending it via PM.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10599

@DorpsGek
Copy link
Member Author

frosch wrote:

Callback 15E of the passenger coach checks the cargo subtype of the front engine of the consist.
This makes the callback return different costs when the front engine is not yet refitted compared to after it is refitted. (As such the cost for refitting the vehicle is different before/after the front engine is refitted. This causes OTTD to throw this error.)

What is the intention of using the var F2 of the front engine when determining the refit cost of some wagon? (Or is this unintentional.)

An example of such tests are sprites 12218, 12229, 12233, 12246, 12247, 12248, any many more.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10601

@DorpsGek
Copy link
Member Author

Snail_ wrote:

I use var F2 of the front engine to determine the livery and, sometimes, the refit options and the refit costs of the wagons attached to that engine.
Each engine that supports multiple liveries is refittable to many subtypes of "passengers", all with a capacity of 0 (effectively, it's a fake cargo I use in the place of "locomotive regearing": I don't use the latter, coz it might be incompatible with some industry sets): each subtype represents a specific livery that the wagons attached to that engine will have.
So, if the front engine is refitted to choice (0), the wagons will appear in a certain way; if it's refitted to choice (1), they'll appear in another way, etc. . Even the attachment rules will change.

This scheme seems to work well, except from that particular care in which it caused a crash, and which I can't replicate...


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10604

@DorpsGek
Copy link
Member Author

Snail_ wrote:

I use var F2 of the front engine to determine the livery and, sometimes, the refit options and the refit costs of the wagons attached to that engine.
Each engine that supports multiple liveries is refittable to many subtypes of "passengers", all with a capacity of 0 (effectively, it's a fake cargo I use in the place of "locomotive regearing": I don't use the latter, coz it might be incompatible with some industry sets): each subtype represents a specific livery that the wagons attached to that engine will have.
So, if the front engine is refitted to choice (0), the wagons will appear in a certain way; if it's refitted to choice (1), they'll appear in another way, etc. . Even the attachment rules will change.

This scheme seems to work well, except from that particular care in which it caused a crash, and which I can't replicate...


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10636

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 3, 2012

frosch wrote:

So, the cost for refitting a passenger wagon between 1st/2nd class depends on the livery refit of the engine.

In that case this seems to be related to #3764.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10656

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 3, 2012

Snail_ wrote:

Yes, it depends on the livery refit of the engine.
Perhaps it's related to 3764, but did it cause OTTD to crash in that case?


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906#comment10657

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 3, 2012

frosch closed the ticket.

Reason for closing: Fixed

in r23743


This comment was imported from FlySpray: https://bugs.openttd.org/task/4906

@DorpsGek DorpsGek closed this as completed Jan 3, 2012
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant