Minor bug: enhancetunnels and steam engines
Moderator: TTDPatch Moderators
Minor bug: enhancetunnels and steam engines
When a steam engine passes over an enhanced tunnel entrance, it temporarily stops producing steam (see the attached screenshot). Obviously that's supposed to happen if a steam engine goes into a tunnel entrance, but not if it goes over the top of one. I'd guess the original TTD code stops engines steaming whenever they're on the same tile as a tunnel entrance, which isn't correct any more now that we have enhancetunnels. I'm using r1582, Windows version, and the bug happens even with no GRFs activated. I've attached my config file, as well as a save demonstrating the bug.
- Attachments
-
- TRP04.SV1
- (82.94 KiB) Downloaded 161 times
-
- ttdpatch.cfg
- (37.01 KiB) Downloaded 142 times
-
- steambug.png (5.06 KiB) Viewed 3158 times
Well, hopefully it won't happen for much longer, because I managed to figure out enough assembly to fix it myself. I've attached a diff of procs/tunbridg.asm and patches/tunbridg.asm against the r1584 versions, as well as the save that I used for a test case (note that I haven't tested under DOS). My code adds an extra check so that, when a steam train is on a tunnel tile, it only stops steaming if it's oriented in the same direction as the tunnel. Could a dev please check whether the code looks okay, and if it does, commit it?
- Attachments
-
- steampatch.png (11.03 KiB) Viewed 3107 times
-
- TRP05.SV1
- (86.79 KiB) Downloaded 155 times
-
- tunnelsteamcheck.diff
- (1.3 KiB) Downloaded 174 times
TTDP with your diff is compiling right now, and then I'm going to do some tests...
I'll also see if the DOS code and windows code are the same (they probably are).
The code looks very good at a glance and I'll say well done, (and very fast as well).
I'll probably commit it soon if I don't find any issues...
JGR
I'll also see if the DOS code and windows code are the same (they probably are).
The code looks very good at a glance and I'll say well done, (and very fast as well).
I'll probably commit it soon if I don't find any issues...
JGR
Slight problem with fragments...
In DOS version steam plume code is before aircraft broken down smoke, and opposite way in windows version, and this may lead to problems.
So I'm widening the search fragment a bit, to avoid any ambiguity.
I can spot no problems at all in the actual code and it passes all of my tests.
I will be committing it shortly.
You clearly know what you are doing with assembly and how the patch works, so you could probably "join the team" so to speak and become an official patch dev if you want and keep up the great work...
JGR
In DOS version steam plume code is before aircraft broken down smoke, and opposite way in windows version, and this may lead to problems.
So I'm widening the search fragment a bit, to avoid any ambiguity.
I can spot no problems at all in the actual code and it passes all of my tests.
I will be committing it shortly.
You clearly know what you are doing with assembly and how the patch works, so you could probably "join the team" so to speak and become an official patch dev if you want and keep up the great work...
JGR
Have you check that any fragments respect that the placement of train, road vehicle, ships and aircraft code varies from Windows to DOS?
I remember there are differences in the order that they are in.
~ Lakie
I remember there are differences in the order that they are in.
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
There is only one instance of the fragment I used, in both the DOS and windows versions, and so these issues largely go away.
The initial fragment by DropZone was one instruction shorter and was present in both the steam plume and aircraft broken-down smoke code, which were in a different order between the two versions.
The fragment now as far as I can tell is OK, and should work fine on any version. I haven't tested it on DOS though.
The only fragment I've added for enhanced tunnels is quite long and only found in one place. (GetTunnelOtherEnd hook)
All the other enhanced tunnel fragments are Oskar's, and I trust that he got them right
JGR
The initial fragment by DropZone was one instruction shorter and was present in both the steam plume and aircraft broken-down smoke code, which were in a different order between the two versions.
The fragment now as far as I can tell is OK, and should work fine on any version. I haven't tested it on DOS though.
The only fragment I've added for enhanced tunnels is quite long and only found in one place. (GetTunnelOtherEnd hook)
All the other enhanced tunnel fragments are Oskar's, and I trust that he got them right
JGR
Who is online
Users browsing this forum: No registered users and 9 guests