News:

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

r2319 - Crash when build a brigde crossong monorail

Started by z9999, February 11, 2009, 12:52:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999

When I build a bridge which is crossing monorail, simutrans crash.

Quote
Message: karte_t::interactive_event(event_t &ev):   calling a tool
Message: brueckenbauer_t::baue():   called on 60,91 for bridge type 'ModernRoad'
Message: brueckenbauer_t::baue():   build from 60,91,0
FATAL ERROR: crossing_t::crossing_t()
requested for waytypes 1 and 5 but nothing defined!
Aborting program execution ...

Please report all fatal errors to

Quote
sim.exe caused an Integer Divide By Zero at location 0058d06d in module sim.exe.

Registers:
eax=0000000f ebx=0023ea40 ecx=00000000 edx=00000000 esi=006d0074 edi=00730070
eip=0058d06d esp=0023e708 ebp=0023e9c8 iopl=0         nv up ei pl zr ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000256

Call stack:
0058D06D  sim.exe:0058D06D  log_t::fatal(char const*, char const*, ...)  log.cc:238
   ...
   if(old_level>4) {
   // generate a division be zero error, if the user request it
>   printf("%i",15/make_this_a_division_by_zero);
   make_this_a_division_by_zero &= 0xFF;
   }
   ...

00402F0E  sim.exe:00402F0E  brueckenbauer_t::baue(karte_t*, spieler_t*, koord, bruecke_besch_t const*)  brueckenbauer.cc:371
   ...
   baue_bruecke(welt, sp, gr->get_pos(), end, zv, besch, wegbauer_t::leitung_besch );
   } else {
>   baue_bruecke(welt, sp, gr->get_pos(), end, zv, besch, weg->get_besch() );
   }
   return NULL;
   ...

0058A064  sim.exe:0058A064  karte_t::interactive()  simworld.cc:4426
   ...
   
   if (!swallowed) {
>   interactive_event(ev);
   }
   
   ...

005B3183  sim.exe:005B3183  WinMain  simsys_w16.cc:756
00401247  sim.exe:00401247
00401298  sim.exe:00401298
7C817067  kernel32.dll:7C817067  RegisterWaitForInputIdle


z9999

Sorry, double post.
Similar problems.

- Power brigde can connect to monorail
- Rail bridge can connect to elevated road

Dwachs

#2
It seems like simutrans wants to create a crossing there! In the monorail case it crashes with the message 'No crossing between waytypes x and y defined'.

Imho, your observation in post 2 is more a feature than a bug ;)

Patch attached.
Parsley, sage, rosemary, and maggikraut.

prissi

Imho Powerlines and crossing also are not intended. Thank you for the bugfix!

z9999

I can't compile it.

Quote
$ make
===> DEP simcity.cc
===> DEP bauer/brueckenbauer.cc
===> CXX bauer/brueckenbauer.cc
bauer/brueckenbauer.cc: In static member function `static koord3d brueckenbauer_t::finde_ende(karte_t*, koord3d, koord, const bruecke_besch_t*, const char*&)':
bauer/brueckenbauer.cc:219: error: expected `while' before "gr2"
bauer/brueckenbauer.cc:219: error: expected `(' before "gr2"
bauer/brueckenbauer.cc:219: error: expected `)' before ';' token
bauer/brueckenbauer.cc: At global scope:
bauer/brueckenbauer.cc:263: error: expected unqualified-id before "while"
bauer/brueckenbauer.cc:266: error: expected constructor, destructor, or type conversion before '=' token
bauer/brueckenbauer.cc:267: error: expected unqualified-id before "return"
bauer/brueckenbauer.cc:268: error: expected declaration before '}' token
make: *** [bauer/brueckenbauer.o] Error 1


Dwachs

Parsley, sage, rosemary, and maggikraut.

z9999


Dwachs

The same bug appears for bridges ending on vertical slopes. Patch attached.
Parsley, sage, rosemary, and maggikraut.

prissi

Wegbauer.cc already contains bool wegbauer_t::check_crossing(). Maybe the logik from there should be reused?

Dwachs

yes, of course! I did not know that.

Another issue: it is still possible to build a bridge through a double slope if a suitable bridge end can be found behind. Hidden feature or bug?
Parsley, sage, rosemary, and maggikraut.

gerw

Also the crossing with leitungen has to be checked (wegbauer_t::check_for_leitung).

Another issue is found with powerline bridges starting/ending on ways (image and patch attached).

prissi

I think the building through a slope should be forbidden too.

Dwachs

Quote from: prissi on February 24, 2009, 09:21:43 AM
I think the building through a slope should be forbidden too.

should be not possible in r2341 anymore.
Parsley, sage, rosemary, and maggikraut.