News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[BUG][INSOLVENCY] Duplicate lines after takeover

Started by Matthew, February 04, 2020, 10:25:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

I started testing the insolvency-gui branch. It's amazing that you can take over a company with only two or three clicks!

However, after taking over a company, a line is duplicated. The game crashes if you attempt to load a save with a company in this state (it might be coincidental, but the backtrace suggests to this non-coder that the two things are linked).

Line duplication - steps to reproduce
1. Build Ves' insolvency-gui branch as of #1f78627fb88bada910edfa20d2e2bd7d9f0cdfde
2. Start Simutrans-Extended and load Pak128.Britain-Ex
3. Load this save.
4. Switch player to Berkthorne Tramway. You have only one line:

Mark your company as available for voluntary takeover.
5. Switch player to Worklow Coach Company and take over Berkthorne Tramway.
6. Open the Line Window and you have multiple Berkthorne Tramway lines:

7. Save your game.

Unable to load save - steps to reproduce
1 and 2 as above.
3. Load the game saved in step 7 above or this game.
4. The game will crash:


The log reports the same:
Warning: karte_t::load: Fileversion: 120004
FATAL ERROR: quickstone<T>::quickstone_tpl(T*,uint16) - slot (15) already taken
Aborting program execution ...


GDB reported the following after I closed the crashed Sim-Ex:
Thread 1 "simutrans-exten" received signal SIGINT, Interrupt.
0x00007ffff7bc7c60 in __GI___nanosleep (requested_time=0x7fffffff2250, remaining=0x7fffffff2240) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
28 ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
(gdb) backtrace
#0  0x00007ffff7bc7c60 in __GI___nanosleep (requested_time=0x7fffffff2250, remaining=0x7fffffff2240)
    at ../sysdeps/unix/sysv/linux/nanosleep.c:28
#1  0x00007ffff7538c85 in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#2  0x000055555595dc42 in log_t::fatal(char const*, char const*, ...) ()
#3  0x00005555558d542e in quickstone_tpl<simline_t>::quickstone_tpl(simline_t*, unsigned short) ()
#4  0x00005555558d4e4c in simline_t::simline_t(player_t*, simline_t::linetype, loadsave_t*) ()
#5  0x00005555558d68a1 in simlinemgmt_t::rdwr(loadsave_t*, player_t*) ()
#6  0x00005555557bc393 in player_t::rdwr(loadsave_t*) ()
#7  0x0000555555944e41 in karte_t::load(loadsave_t*) ()
#8  0x000055555594798e in karte_t::load(char const*) ()
#9  0x0000555555726058 in loadsave_frame_t::item_action(char const*) ()
#10 0x0000555555741fd9 in savegame_frame_t::action_triggered(gui_action_creator_t*, value_t) ()
#11 0x00005555559aded7 in gui_table_t::infowin_event(event_t const*) ()
#12 0x00005555556b64aa in gui_scrollpane_t::infowin_event(event_t const*) ()
#13 0x00005555556aa09e in gui_container_t::infowin_event(event_t const*) ()
#14 0x00005555556fb14a in gui_frame_t::infowin_event(event_t const*) ()
#15 0x0000555555776305 in check_pos_win(event_t*) ()
#16 0x00005555558cd07a in interaction_t::process_event(event_t&) ()
#17 0x00005555558cd79b in interaction_t::check_events() ()
#18 0x0000555555956d04 in karte_t::interactive(unsigned int) ()
#19 0x00005555558dc4b4 in simu_main(int, char**) ()
#20 0x00005555558f2042 in sysmain(int, char**) ()
#21 0x00007ffff6748b97 in __libc_start_main (main=0x5555555ab400 <main>, argc=5, argv=0x7fffffffdfc8, init=<optimised out>,
    fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffdfb8) at ../csu/libc-start.c:310
#22 0x00005555555ab46a in _start ()

(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Mariculous

Not part of the buglisting as it is part of the master branch.
I am not quite sure if I should include such as dev branches tend to change quite often, however, I guess git isssues fit here well.

jamespetts

Thank you for your report. I believe that I have now fixed this on the insolvency branch - I should be grateful if you could re-test and confirm.
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.