File diff r11919:363b629324b9 → r11920:e51276f97f18
src/station_cmd.cpp
Show inline comments
 
@@ -2696,13 +2696,17 @@ static VehicleEnterTileStatus VehicleEnt
 
		}
 
	}
 

	
 
	return VETSB_CONTINUE;
 
}
 

	
 
/* this function is called for one station each tick */
 
/**
 
 * This function is called for each station once every 250 ticks.
 
 * Not all stations will get the tick at the same time.
 
 * @param st the station receiving the tick.
 
 */
 
static void StationHandleBigTick(Station *st)
 
{
 
	UpdateStationAcceptance(st, true);
 

	
 
	if (st->facilities == 0 && ++st->delete_ctr >= 8) delete st;
 

	
 
@@ -2836,25 +2840,21 @@ static void StationHandleSmallTick(Stati
 
}
 

	
 
void OnTick_Station()
 
{
 
	if (_game_mode == GM_EDITOR) return;
 

	
 
	uint i = _station_tick_ctr;
 
	if (++_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
 

	
 
	if (Station::IsValidID(i)) StationHandleBigTick(Station::Get(i));
 

	
 
	Station *st;
 
	FOR_ALL_STATIONS(st) {
 
		StationHandleSmallTick(st);
 

	
 
		/* Run 250 tick interval trigger for station animation.
 
		 * Station index is included so that triggers are not all done
 
		 * at the same time. */
 
		if ((_tick_counter + st->index) % 250 == 0) {
 
			StationHandleBigTick(st);
 
			StationAnimationTrigger(st, st->xy, STAT_ANIM_250_TICKS);
 
		}
 
	}
 
}
 

	
 
void StationMonthlyLoop()
 
@@ -3208,14 +3208,12 @@ void InitializeStations()
 
	_Station_pool.CleanPool();
 
	_Station_pool.AddBlockToPool();
 

	
 
	/* Clean the roadstop pool and create 1 block in it */
 
	_RoadStop_pool.CleanPool();
 
	_RoadStop_pool.AddBlockToPool();
 

	
 
	_station_tick_ctr = 0;
 
}
 

	
 
static CommandCost TerraformTile_Station(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
{
 
	if (_settings_game.construction.build_on_slopes && AutoslopeEnabled()) {
 
		/* TODO: If you implement newgrf callback 149 'land slope check', you have to decide what to do with it here.