Skip to main content
Topic: Replacer not quite working right yet in 8.0.... (Read 2093 times) previous topic - next topic

Replacer not quite working right yet in 8.0....

So I tried out the replacer in James's devel branch.  It worked great for replacing Hackney carriages with Omnibuses (which was lovely, as there were dozens of hackneys).  This led me to be overly optimistic.   ;D

Replacing goods trains didn't work right.  I attempted to replace a Puffing Billy with a whole lot of 2t bulk trucks with a Lion with a whole lot (27) of 5t bulk trucks.  I got some real weirdness -- a Lion driving around with invisible goods wagons, reserving the wrong sections of track, and finally causing a crash.  It's clearly generating bad data.

Also, the "replace all vehicles of this type" crashes immediately, but you probably knew that.

Re: Replacer not quite working right yet in 8.0....

Reply #1
Neroden,

thank you very much for the report. I think that I have fixed the weirdness problem - have a look at the latest commit. As for the "replace all vehicles of this type" - it doesn't crash for me. Can you give me a backtrace?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Replacer not quite working right yet in 8.0....

Reply #2
Ugh, it's crashing in the load-game code again.  That bug where two paks have names where one is a prefix of the other, which I mentioned earlier?  Really, really annoying when doing pak debugging.

Anyway, after renaming the second pak folder, I was able to test.  You still have ****ertions turned off, eh?

sim: simwerkz.cc:5224: virtual bool wkz_change_convoi_t::init(karte_t*, spieler_t*): ****ertion `cnv_rpl.is_bound()' failed.

Remainder of backtrace:

Code: [Select]
#4  0x082299ad in wkz_change_convoi_t::init(karte_t*, spieler_t*) ()
#5  0x0824cfef in karte_t::local_set_werkzeug (this=0xcfde960, w=0x8c19888,
    sp=0xd3dffd8) at simworld.cc:2335
#6  0x081d024e in convoi_t::call_convoi_tool (this=0xf07a3b8, function=67 'C',
    extra=0xf29d478 "0") at simconvoi.cc:434
#7  0x0815918f in replace_frame_t::replace_convoy (this=0xf299da8, cnv_rpl=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
)
    at gui/replace_frame.cc:434
#8  0x08159456 in replace_frame_t::action_triggered (this=0xf299da8,
    komp=0xf299edc, p=...) at gui/replace_frame.cc:547
#9  0x080dff87 in gui_action_creator_t::call_listeners (this=0xf299edc, v=...)
    at gui/components/../../ifc/gui_action_creator.h:36
#10 0x080e01ab in button_t::infowin_event (this=0xf299ecc, ev=0xbfffd2b4)
    at gui/components/gui_button.cc:337
#11 0x081286c5 in gui_container_t::infowin_event (this=0xf299dac,
    ev=0xbfffd310) at gui/gui_container.cc:93
#12 0x08129879 in gui_frame_t::infowin_event (this=0xf299da8, ev=0xbfffd3c4)
    at gui/gui_frame.cc:89
#13 0x08158d2f in replace_frame_t::infowin_event (this=0xf299da8,
    ev=0xbfffd3c4) at gui/replace_frame.cc:567
#14 0x082452ab in check_pos_win (ev=0xbfffd4a0) at simwin.cc:938
#15 0x08269968 in karte_t::interactive (this=0xcfde960, quit_month=2147483647)
    at simworld.cc:5563
#16 0x08216ac7 in simu_main (argc=1, argv=0xbffff434) at simmain.cc:1068
#17 0x082a43ca in main (argc=1, argv=0xbffff434) at simsys_s.cc:743

Thanks very much for fixing the weirdness.  Being able to replace an entire line of trains is very pleasing.  :-)

 

Re: Replacer not quite working right yet in 8.0....

Reply #3
Neroden,

****ertions should be on for debug builds and off for release builds (those that are built automatically and made available for download). Is that not the pattern that is working out in practice? Because I use Windows, it's difficult for me to see how these things pan out on other platforms - I know that I have it set up correctly for Windows.

Thank you for the backtrace - problem found and fixed in the -devel branch.

(As for the loading issue - perhaps Bernd could look into that, since he's been dealing with loading/saving issues recently...?)
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.