recalc_status() calls in haltestelle_t::step() November 25, 2009, 11:26:51 am Hi Prissi,Quotebool haltestelle_t::step(sint16 &units_remaining){// DBG_MESSAGE("haltestelle_t::step()","%s (cnt %i)",get_name(),reroute_counter); if(rebuilt_destination_counter!=welt->get_schedule_counter()) { // schedule has changed ... status_step = RESCHEDULING; units_remaining -= (rebuild_destinations()/256)+2; } else if(reroute_counter!=welt->get_schedule_counter()) { // all new connection updated => recalc routes status_step = REROUTING; if( !reroute_goods(units_remaining) ) { return false; } recalc_status(); } else { // nothing needs to be done status_step = 0; units_remaining = 0; } // only update needed after monthly change: really slow, but does not matter at all recalc_status(); return true;}May I know why there are 2 calls to recalc_status()? During rerouting, if rerouting of the current halt is complete instead of partial, recalc_status() will be called twice. Is there any particular reason for this?Knightly Quote Selected
Re: recalc_status() calls in haltestelle_t::step() Reply #1 – November 25, 2009, 09:28:47 pm Checked in in the middle of code change. The scond can go completely. Quote Selected