The International Simutrans Forum

 

Author Topic: 9.3: City hall placed on 2 different levels  (Read 3300 times)

0 Members and 1 Guest are viewing this topic.

Offline Brambo

  • *
  • Posts: 44
9.3: City hall placed on 2 different levels
« 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!

Offline paco_m

  • *
  • Posts: 170
Re: 9.3: City hall placed on 2 different levels
« Reply #1 on: March 07, 2011, 04:22:31 PM »
This is a problem also existing in Simutrans standard.

Offline Brambo

  • *
  • Posts: 44
Re: 9.3: City hall placed on 2 different levels
« Reply #2 on: March 07, 2011, 04:23:58 PM »
Hmmm I suspected so, thanks.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19968
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: 9.3: City hall placed on 2 different levels
« Reply #3 on: March 07, 2011, 05:28:38 PM »
On the basis of Paco_M's report, this has been moved to the Standard board.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10031
  • Languages: De,EN,JP
Re: 9.3: City hall placed on 2 different levels
« Reply #4 on: March 07, 2011, 07:49:21 PM »
It is new for me that this exists in standard. Any field satisfies this conditions:

Code: [Select]
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.
« Last Edit: March 07, 2011, 08:01:36 PM by prissi »

Offline paco_m

  • *
  • Posts: 170
Re: 9.3: City hall placed on 2 different levels
« Reply #5 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


2) townhall after upgrade
« Last Edit: March 07, 2011, 08:03:54 PM by paco_m »

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4711
  • Languages: EN, DE, AT
Re: 9.3: City hall placed on 2 different levels
« Reply #6 on: March 07, 2011, 08:23:50 PM »
that report helped a lot.

Edit: should be fixed with rev 4345.
« Last Edit: March 07, 2011, 08:38:35 PM by Dwachs »