I am not sure if it is a bug -- please pardon me if I am wrong.
In the following code,
min() in the body of the 2nd
if seems to be comparing the same value, as
obj_bei() is called with argument
0 in both bodies of
if :
int grund_t::get_max_speed() const
{
int max = 0;
if(flags&has_way1) {
max = ((weg_t *)obj_bei(0))->get_max_speed();
}
if(flags&has_way2) {
max = min( max, ((weg_t *)obj_bei(0))->get_max_speed() );
}
return max;
}
Thank you for your attention.
imho there should be obj_bei(1), as the ways on one tile are hard-coded at indices 0 and 1.
How did you come across this?
Sorry, forgot to mention that I discovered this with R2431.
I came across this when I read Simutrans code out of interest. :)
Please read more ;)
This bug was not critical, the routine is only used in the gui (map).
Thanks for reporting, should be fixed now.