Bug #4766

Misalignment Mat'36

Added by Transportman over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:2013-01-07
Priority:NormalDue date:
Assignee:foobar% Done:

100%

Category:Graphics
Target version:2.0.0-beta1

Description

As reported on the forum, misalignment of the Mat'36 EI3/EID3 last wagon in the West-driving direction for both liveries.

http://www.tt-forums.net/viewtopic.php?f=26&t=5033&start=7260#p1060672

Mat36 ELD3 gap fi.diff Magnifier - Fix (550 Bytes) Transportman, 2013-01-08 17:27

Heerhugerpomp Transport, 6th Feb 1950.png - Screenshot (30.7 KB) Transportman, 2013-01-13 14:14

Associated revisions

Revision 664:d15d8c958fa8
Added by foobar over 5 years ago

Fix: Mat'36 ELD3 length callback (Transportman) (issue #4766)

Revision 667:e02feb8e3886
Added by foobar over 5 years ago

Fix: alignment of dark green Mat'36 EL3 (closes #4766)

History

#1 Updated by Transportman over 5 years ago

  • Subject changed from Misalignment Mat'36 to Misalignment Mat'36
  • Assignee deleted (Transportman)
  • Estimated time deleted (1.00)

Problem is in the late version with the short wagon. Apparently the code or OpenTTD misses the fact that it is a shorter wagon.

#2 Updated by Transportman over 5 years ago

  • Subject changed from Misalignment Mat'36 to Misalignment Mat'36

Just checked: It is present in all directions.

#3 Updated by Transportman over 5 years ago

Attached .diff should fix it.

What likely happened in the code is the following (assuming 1942 or later):
switch_emu_Mat36ELD3_length_pos is runned 3 times, for each part. But each time it asks for the position_in_vehid_chain %3 of the PARENT vehicle, which is the front engine according to the spec ( http://newgrf-specs.tt-wiki.net/wiki/NML:Switch ). Thus, it always takes the value belonging to the front engine (0), so it always returns 8 instead of 7 for the wagon.

I don't know which other vehicles have their length depend on the year, but maybe it is also wrong for those.

#4 Updated by Transportman over 5 years ago

  • Assignee set to foobar
  • % Done changed from 0 to 50

#5 Updated by Transportman over 5 years ago

  • Subject changed from Misalignment Mat'36 to Misalignment Mat'36

Only thing that happens with my fix is that it somehow shifts the front engine 1 px up.

#6 Updated by foobar over 5 years ago

That's weird, as the fix should not influence the first vehicle part.
The fix is correct though. Checking PARENT here doesn't make sense and is obviously a typo.

I'll look into it this weekend I guess. Feel free to look into it before me though :)

#7 Updated by foobar over 5 years ago

  • % Done changed from 50 to 100
  • Status changed from Confirmed to Closed
  • Subject changed from Misalignment Mat'36 to Misalignment Mat'36

I checked after applying the fix, but didn't see any shifting of front engines. So that maybe was a random quirk. Let's consider this fixed for now and see if it reoccurs.

#8 Updated by Transportman over 5 years ago

Unfortunately, it doesn't look like a random quirk, but I have narrowed the cases. It only happens with the olive livery, the front is correct, the middle and back miss their bottom row of pixels. See attached screenshot, left is the green livery which is correct, to the right is the green livery with the missing pixels.

#9 Updated by foobar over 5 years ago

  • Status changed from Reopened to Closed
  • % Done changed from 80 to 100

Applied in changeset e02feb8e3886.

Also available in: Atom PDF