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

Parsing of words following codes 81 and 9A 03 in GRF strings #2228

Closed
DorpsGek opened this issue Aug 15, 2008 · 2 comments
Closed

Parsing of words following codes 81 and 9A 03 in GRF strings #2228

DorpsGek opened this issue Aug 15, 2008 · 2 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

minime opened the ticket and wrote:

I can only verify that this bug occurs under MSVC 9.0 debug build. Release builds seem to work fine.

When a word value is parsed from a GRF string (following "push word" and "print following text id" control codes), the first int8 read from the string first gets sign extended, causing the resulting value being invalid.

This eventually causes OTTD to hit a NOT_REACHED, when attempting to look up such mangled text ID.

The attached GRF should demonstrate this issue (go to year 2010, and view purchase screen details of a blue el. train engine called '380'). The attached patch fixes the problem.

Attachments

Reported version: trunk
Operating system: Windows


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

minime wrote:

Oops, I accidentally labeled this as Work in progress, when it is obviously a patch. Sorry.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2228#comment4601

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

In r14087.


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

@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 6, 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