News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

narrow diagonals if season change

Started by makie, July 22, 2026, 10:51:44 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

makie

narrow diagonals if season change
Ok it is only optical.

All fine

winter is comming 

after rotate 4 times

summer is coming

after rotate 4 time look first picture

makie

drawing (building) tunnel 90km/h (pak128.german)

after leaving the underground mod and reenter underground

now it is fine

victor_18993

Found it - it is the season recalc picking the wrong image for a close diagonal.

A close diagonal is a four-way tile (ribi==all, diagonal_flag==0). calc_image() handles
it exclusively: its threeway branch gives it the close-diagonal image, or the matching
diagonal image when the pakset has no close-diagonal one. But check_season() (the fast
season-only recalc) is not exclusive:

  if( is_close_diagonal() ) { set close-diagonal image; }  // A
  if( is_diagonal() )      { ... }                          // B  <- separate if
  else if( threeway && !road ) { set switch image; }        // C
  else { flat }

For a close diagonal is_diagonal() is false, so it skips B and runs C, which overwrites
the image from A. On a season change the tile is redrawn as a straight four-way image
instead of a diagonal - the "narrow" look.

The A block was added in front of the old if(is_diagonal()) without turning it into
else if; calc_image() (same code) is already exclusive, only the season path was missed.

Reproduced on a flat map with the minimal close diagonal (a four-way centre whose four
neighbours are all bends). Comparing, on the same tile and season, the image the two
paths choose: calc_image=6625 (the diagonal), check_season=6610 (the flat four-way).
After the patch both give 6625.

Patch: in check_season() make the block an if/else if chain and mirror calc_image()'s
fallback. One file, upstream suite still passes. Applies on r12096.

I could not reproduce the "rotate 4 times" part directly - rotate90() toggles
close_diagonal_state without recalculating the image, so I think rotation just forces a
recalc that hits the same bug, but I did not prove that.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

prissi

Both should be fixed in r12098

makie

I think its fixed.

Thanks very much.  :thumbsup:  :thumbsup:

victor_18993

Thanks for confirming it, and thanks to prissi for fixing both issues so quickly.
I checked the result as well and everything now looks correct on my side. Nice to see this one resolved. 🙂
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)