Skip to main content
Topic: [solved] Wrong stadt_t weight after loading savegame (Read 3414 times) previous topic - next topic

[solved] Wrong stadt_t weight after loading savegame

Weight of stadt_t is only updated at start of new month.
When simutrans loads saved game and append stadt, buildings are not yet appnded.
So, get_einwohner() returns wrong value and this value doesn't recalculate until next month.

So, during up to one month after loading saved game, p****engers will determine their destination by wrong weight.

Code: [Select]
	stadt.clear();
stadt.resize(einstellungen->get_anzahl_staedte());
for(int i=0; i<einstellungen->get_anzahl_staedte(); i++) {
stadt_t *s = new stadt_t(this, file);
stadt.append( s, s->get_einwohner(), 64 );

Solved in r2502. thank you.