OpenTTD

Tasklist

FS#4778 - OpenTTD Crash Report

Attached to Project: OpenTTD
Opened by Aleksandr (aleksandrkomi) - Sunday, 18 September 2011, 10:15 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 23 September 2011, 19:55 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System Windows
Severity Critical
Priority Normal
Reported Version 1.1.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

have saved the file version 1.0.1
I want to open it in version 1.1.3
is the error
   OpenTTD.rar (442.9 KiB)
This task depends upon

Closed by  Remko Bijker (Rubidium)
Friday, 23 September 2011, 19:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r22958
Comment by Ingo von Borstel (planetmaker) - Monday, 19 September 2011, 07:30 GMT
can you please attach the savegame which you tried to load, which caused the crash?
Comment by Matt D. (monoid) - Monday, 19 September 2011, 15:33 GMT
This crash appears to be due to a discrepancy between the English and Russian language strings, namely STR_SAVELOAD_DETAIL_COMPANY_INDEX:
http://hg.openttd.org/openttd/branches/1.1.hg/file/b81203d3886e/src/lang/english.txt#l2309
http://hg.openttd.org/openttd/branches/1.1.hg/file/b81203d3886e/src/lang/russian.txt#l2483

This string is used in the fios GUI here: http://hg.openttd.org/openttd/branches/1.1.hg/file/b81203d3886e/src/fios_gui.cpp#l451

Note that the English string uses a STRING1 parameter, since c.name_1 can use c.name_2 as a parameter. However, the Russian string only uses a STRING parameter, and there is a warning explicitly against this: http://hg.openttd.org/openttd/branches/1.1.hg/file/b81203d3886e/src/strings.cpp#l998
Comment by Matt D. (monoid) - Monday, 19 September 2011, 15:34 GMT
(Also, STR_JUST_RAW_STRING obviously uses c.name as a parameter in the other if-case.)
Comment by Remko Bijker (Rubidium) - Monday, 19 September 2011, 16:32 GMT
Regarding STRINGn/RAW_STRING vs STRING. The tool that compiles the languages replaces STRING with STRINGn/RAW_STRING depending on the value in english.txt. As such all languages are using the same STRINGn/RAW_STRING. It also makes changing STRINGn to STRINGm much easier.
Comment by Remko Bijker (Rubidium) - Monday, 19 September 2011, 16:59 GMT
Without the savegame I've got the following hypothesis:
- with 1.0.1, the Russian modified 1.0.1 is meant which adds a Russian town name.
- the Russian town name generator is chosen.

However, 1.1.3 does not have the Russian town name generator, and thus it does not reach "$town_name Transport" case it should have reached.
Comment by Matt D. (monoid) - Monday, 19 September 2011, 17:18 GMT
Your hypothesis appears correct: it is setting the string parameters using c.name_1 and c.name_2, which are 0x70FF and 0 respectively. The 0x70FF indicates a string with tab = 14, and index = 0xFF. Therefore it's a special name string with ind = 0xFF - 0xE4 = 0x1B, which is just past the end of the town name range.

RE: {STRING} vs {STRING1}: oops, you're right.
Comment by Aleksandr (aleksandrkomi) - Monday, 19 September 2011, 17:35 GMT
saved game
Comment by Matt D. (monoid) - Monday, 19 September 2011, 18:26 GMT
Yup, that is the case. (Except c.name_2 is 0xc389694c and not 0 - not that this relates to the problem)
Comment by Aleksandr (aleksandrkomi) - Saturday, 24 September 2011, 07:29 GMT
You fix a bug?
Comment by Alberth (Alberth) - Saturday, 24 September 2011, 07:52 GMT
This one is not fixable in 1.1.3, as it does not have the Russian name generator of your modified 1.0.1 version.
The only thing that can be done (and has been done) is to prevent 1.1.3 from crashing on your modified save game.

You can continue your game with the modified 1.0.1 version, or
apply your modifications to a 1.1.3 version yourself before loading your modified save game into it.

A much better alternative to this whole mess is to find a russian town-name grf and use that, instead of changing the program code.

Loading...