The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: pwhk on September 30, 2013, 01:25:12 PM

Title: Cursor unable to go beyond altitude 14?
Post by: pwhk on September 30, 2013, 01:25:12 PM
Just happen to have a map number (No. 3242 which I mentioned in the random map thread) that generates really high mountains.

This is not a problem. However, apparently, the cursor cannot go up further when the land altitude is beyond 14.
Title: Re: Cursor unable to go beyond altitude 14?
Post by: Markohs on September 30, 2013, 02:15:47 PM
I think this comes from standard code, simworld.cc, line 6483:


const sint8 hmax = grund_t::underground_mode == grund_t::ugm_all ? get_maximumheight() : min( grund_t::underground_level, get_maximumheight() );


Before I got my dirty hands on that line, it was a literal constant inlined in code, now it's a constant too, but a bit different:

simworld.h line 1225:


sint8 get_maximumheight() const { return 32; }


32 is not 14, what was the water level in that map?
Title: Re: Cursor unable to go beyond altitude 14?
Post by: pwhk on October 01, 2013, 01:51:37 AM
default -2 I think
Title: Re: Cursor unable to go beyond altitude 14?
Post by: Markohs on October 01, 2013, 11:15:37 AM
On simutrans experimental that value is 14, I don't know why, james might know more about it. On standard is 32 as I already said. :)

Line 1497:
https://github.com/jamespetts/simutrans-experimental/blob/master/simworld.h (https://github.com/jamespetts/simutrans-experimental/blob/master/simworld.h)

EDIT: In standard that value was 14 too, until update 6530, kierongreen's patch to implement double heights, I guess experimental has not imported that patch yet.

Modifying that value in current code won't cause trouble, only that cursor movement will check more tiles, not critical for performance.
Title: Re: Cursor unable to go beyond altitude 14?
Post by: kierongreen on October 01, 2013, 09:13:57 PM
Just a note here - if you generate really rough maps in a single height pak then import these into double height at a later stage unpredictable things might happen...
Title: Re: Cursor unable to go beyond altitude 14?
Post by: jamespetts on October 04, 2013, 11:09:04 PM
Thank you for the information/suggestions here. I have now increased the level to 32 on the 11.x branch.