News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

[r8460] Auto-names of stops with coordinate > 16384

Started by Antarctica, May 25, 2018, 02:43:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Antarctica

I have a map of size 20480 x 32.
I have a town hall "Bürstadt" in x = 16371-72, y = 14-15.
I have a town hall "Oestrich-Winkel" in x = 16399-16400, y = 16 -17
A stop built at x = 16403, y = 15 is named after Bürstadt, which is 32 tiles away, not after Oestrich-Winkel, which is 3 tiles away.
Many other stops built at x > 16371, y = 15 are also named after Bürstadt.

Since 16371 is near 16384, which is 2^14, is it possible that there is some overflow error during distance calculation?


Dwachs

Yes, there was an overflow occuring. Coordinates are stored as 16bit signed integer. Adding two coordinates that large gives something negative... Should be fixed in r8461, There might be more such errors occurring on these long thin maps.
Parsley, sage, rosemary, and maggikraut.

Antarctica

Thank you. I will continue building and report any issues I stumble upon.