bool 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;
}