The International Simutrans Forum

 

Author Topic: [solved] Wrong stadt_t weight after loading savegame  (Read 2566 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
[solved] Wrong stadt_t weight after loading savegame
« on: June 03, 2009, 12:45:36 PM »
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, passengers 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.
« Last Edit: June 04, 2009, 12:29:54 PM by z9999 »