diff options
author | smatz <smatz@openttd.org> | 2009-08-06 17:02:49 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-08-06 17:02:49 +0000 |
commit | 88a2d688da29b6beb822c5671927d0543104755f (patch) | |
tree | 881761645cdedc2003f05cac8a3897d1f40fe744 /src/date.cpp | |
parent | 0ab39b52d088d7290b051777c4e808897dc02523 (diff) | |
download | openttd-88a2d688da29b6beb822c5671927d0543104755f.tar.xz |
(svn r17089) -Codechange: move RunVehicleDayProc() to vehicle.cpp
Diffstat (limited to 'src/date.cpp')
-rw-r--r-- | src/date.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/date.cpp b/src/date.cpp index b9c47bfa2..287cddb7f 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -262,37 +262,16 @@ static void OnNewDay() } /** - * Runs the day_proc for every DAY_TICKS vehicle starting at daytick. - */ -static void RunVehicleDayProc(uint daytick) -{ - for (size_t i = daytick; i < Vehicle::GetPoolSize(); i += DAY_TICKS) { - Vehicle *v = Vehicle::Get(i); - - if (v != NULL) { - /* Call the 32-day callback if needed */ - CheckVehicle32Day(v); - v->OnNewDay(); - } - } -} - -/** * Increases the tick counter, increases date and possibly calls * procedures that have to be called daily, monthly or yearly. */ void IncreaseDate() { - if (_game_mode == GM_MENU) { - _tick_counter++; - return; - } - - RunVehicleDayProc(_date_fract); - /* increase day, and check if a new day is there? */ _tick_counter++; + if (_game_mode == GM_MENU) return; + _date_fract++; if (_date_fract < DAY_TICKS) return; _date_fract = 0; |