The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Brambo on March 07, 2011, 04:15:24 PM

Title: 9.3: City hall placed on 2 different levels
Post by: Brambo on March 07, 2011, 04:15:24 PM
Hello,

Can't find this reported yet, so here it goes: I have run into a bug in Simutrans Exp 9.3 (with pakBritain.128 standard 1.08). The city hall in Galashiels (in a new game) is placed on both level -1 and 0 (2 tiles each). The graphic is displayed accordingly, leading to a rather broken up city hall. See the save:

http://www.megaupload.com/?d=P0C06H9K

Hope this helps fixing it!
Title: Re: 9.3: City hall placed on 2 different levels
Post by: paco_m on March 07, 2011, 04:22:31 PM
This is a problem also existing in Simutrans standard.
Title: Re: 9.3: City hall placed on 2 different levels
Post by: Brambo on March 07, 2011, 04:23:58 PM
Hmmm I suspected so, thanks.
Title: Re: 9.3: City hall placed on 2 different levels
Post by: jamespetts on March 07, 2011, 05:28:38 PM
On the basis of Paco_M's report, this has been moved to the Standard board.
Title: Re: 9.3: City hall placed on 2 different levels
Post by: prissi on March 07, 2011, 07:49:21 PM
It is new for me that this exists in standard. Any field satisfies this conditions:


const grund_t* gr = welt->lookup_kartenboden(pos + d);
if (gr == NULL  ||  gr->get_grund_hang() != hang_t::flach) return false;

if (((1 << welt->get_climate(gr->get_hoehe())) & cl) == 0) {
return false;
}

if (d.x > 0 || d.y > 0) {
if (welt->lookup_kartenboden(pos)->get_hoehe() != gr->get_hoehe()) {
// height wrong!
return false;
}
}

if ( ((dir & ribi_t::sued)!=0  &&  d.y == h - 1) ||
((dir & ribi_t::west)!=0  &&  d.x == 0) ||
((dir & ribi_t::nord)!=0  &&  d.y == 0) ||
((dir & ribi_t::ost)!=0  &&  d.x == b - 1)) {
// we want to build a road here:
return
gr->get_typ() == grund_t::boden &&
(!gr->hat_wege() || (gr->hat_weg(road_wt) && !gr->has_two_ways())) && // build only on roads, no other ways
!gr->is_halt() &&
gr->kann_alle_obj_entfernen(NULL) == NULL;
} else {
// we want to build the townhall here: maybe replace existing buildings
return ((gr->get_typ()==grund_t::boden  &&  gr->ist_natur()) || gr->get_typ()==grund_t::fundament) &&
gr->kann_alle_obj_entfernen(NULL) == NULL;
}

i.e. is either flat or can be flatted. (It was reported once years ago and then some fixes were applied.)

I tried a lot on mountanieous maps but could not generate a broken townhall.
Title: Re: 9.3: City hall placed on 2 different levels
Post by: paco_m on March 07, 2011, 07:54:14 PM
we had this with R4277 in the network game,
actually it works fine when the townhall is built but later when upgrading the townhall the error occurs:

1) townhall before upgrade
(http://www.simutrans-forum.de/forum/attachment.php?attachmentid=13749&thumbnail=1)

2) townhall after upgrade
(http://www.simutrans-forum.de/forum/attachment.php?attachmentid=13750&thumbnail=1)
Title: Re: 9.3: City hall placed on 2 different levels
Post by: Dwachs on March 07, 2011, 08:23:50 PM
that report helped a lot.

Edit: should be fixed with rev 4345.