Bug #66
Crash, when CB 19 cargo subtypes fail to load ...
0%
Description
TTDPatch Version: 2.5 beta 6
Patch Feature: callbacks 19/36
Prior to 2.5 beta 6 there are no problems. The crashlog reports : while processing callback 36, this is misleading but it may have
something to do with it. The Canadian Trainset does NOT use callback 36 at all !!
The actual problem, with 2.5 beta 6, is that callback 19 fails to load the cargo subtype texts and the game crashes when querying
vehicle variable F2 (refit cycle) lateron.
Crash can be reproduced easily :
. use CanSetw.grf (version 0.2g)
. set date to 1990
. buy 'BBD LRC-3' or 'F40PH-2' engine
. attach lightweight passenger coach or mail car
. CRASH
Code :
4979 * 9 02 00 00 01 01 00 00 00 00
4980 * 9 02 00 1F 01 01 01 00 01 00
4981 * 14 02 00 9A 82 42 18 80 01 45 00 80 80 46 00
4982 * 14 02 00 9B 81 F2 00 FF 01 27 00 00 00 26 00
4983 * 14 02 00 9C 82 42 18 80 01 25 00 80 80 9B 00
4984 * 18 02 00 9D 81 F2 00 FF 02 63 FF 00 00 62 FF 01 01 FF FF
4985 * 14 02 00 9E 82 42 18 80 01 FF FF 80 80 9D 00
4986 * 14 02 00 9F 81 0C 00 FF 01 9E 00 19 19 9C 00
4987 * 18 02 00 AC 81 F2 00 FF 02 62 FF 00 00 63 FF 01 01 FF FF
4988 * 14 02 00 DF 81 0C 00 FF 01 AC 00 19 19 00 00
4989 * 14 02 00 EF 81 0C 00 FF 01 BE FF 23 23 1F 00
4990 * 10 03 00 01 50 01 FF EF 00 DF 00
4991 * 7 03 00 81 28 00 9F 00
4992 * 7 03 00 81 2B 00 9A 00
4993 * 7 03 00 81 57 00 52 00
If sprite 4986 were to fail CB36 immediately, as follows
4986 * 18 02 00 9F 81 0C 00 FF 02 9E 00 19 19 00 00 36 36 9C 00
then there won't be a crash, although CB 19 still fails to load the subtype texts and the train won't be refittable.
Another theory, CB 36 executes before CB 19 and therefore encounteres unset vehicle variable F2 (refit cycle).