summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-06 18:22:25 +0000
committerdarkvater <darkvater@openttd.org>2004-09-06 18:22:25 +0000
commitaa0212515882c5a90c3f2cb86f05952b832a5a9f (patch)
treeef79f4519291cb14b916d6ee44f742eedae48690
parentbf0652d3fce57024fe56f75d43898a261fea7570 (diff)
downloadopenttd-aa0212515882c5a90c3f2cb86f05952b832a5a9f.tar.xz
(svn r166) -Codechange: change 74 for constant DAY_TICKS
-rw-r--r--ai.h2
-rw-r--r--ai_new.c7
-rw-r--r--graph_gui.c4
-rw-r--r--players.c4
4 files changed, 8 insertions, 9 deletions
diff --git a/ai.h b/ai.h
index dca9b59fe..19f741bab 100644
--- a/ai.h
+++ b/ai.h
@@ -134,7 +134,7 @@
#define AI_CHECK_MAX_VEHICLE_PER_STATION 10
// How many thick between building 2 vehicles
-#define AI_BUILD_VEHICLE_TIME_BETWEEN 74
+#define AI_BUILD_VEHICLE_TIME_BETWEEN DAY_TICKS
// How many days must there between vehicle checks
// The more often, the less non-money-making lines there will be
diff --git a/ai_new.c b/ai_new.c
index e4bc3babe..c0a8c661a 100644
--- a/ai_new.c
+++ b/ai_new.c
@@ -65,8 +65,7 @@ static void AiNew_State_FirstTime(Player *p) {
static void AiNew_State_Nothing(Player *p) {
assert(p->ainew.state == AI_STATE_NOTHING);
// If we are done idling, start over again
- // There go 74 ticks in a day
- if (p->ainew.idle == 0) p->ainew.idle = RandomRange(74 * 2) + 74;
+ if (p->ainew.idle == 0) p->ainew.idle = RandomRange(DAY_TICKS * 2) + DAY_TICKS;
if (--p->ainew.idle == 0) {
// We are done idling.. what you say? Let's do something!
// I mean.. the next tick ;)
@@ -831,7 +830,7 @@ static int AiNew_HowManyVehicles(Player *p) {
length = p->ainew.path_info.route_length;
// Calculating tiles a day a vehicle moves is not easy.. this is how it must be done!
// ROAD_ENGINES_INDEX is because the first roadveh engine is ROAD_ENGINES_INDEX, and _roadveh_speed starts from 0
- tiles_a_day = _roadveh_speed[i-ROAD_ENGINES_INDEX] * 74 / 256 / 16;
+ tiles_a_day = _roadveh_speed[i-ROAD_ENGINES_INDEX] * DAY_TICKS / 256 / 16;
// We want a vehicle in a station once a month at least, so, calculate it!
// (the * 2 is because we have 2 stations ;))
amount = ((int)(((float)length / (float)tiles_a_day / 30 * 2))) * 2;
@@ -847,7 +846,7 @@ static int AiNew_HowManyVehicles(Player *p) {
length = p->ainew.path_info.route_length;
// Calculating tiles a day a vehicle moves is not easy.. this is how it must be done!
// ROAD_ENGINES_INDEX is because the first roadveh engine is ROAD_ENGINES_INDEX, and _roadveh_speed starts from 0
- tiles_a_day = _roadveh_speed[i-ROAD_ENGINES_INDEX] * 74 / 256 / 16;
+ tiles_a_day = _roadveh_speed[i-ROAD_ENGINES_INDEX] * DAY_TICKS / 256 / 16;
if (p->ainew.from_deliver)
max_cargo = DEREF_INDUSTRY(p->ainew.from_ic)->total_production[0];
else
diff --git a/graph_gui.c b/graph_gui.c
index 29b9165a0..330cefb78 100644
--- a/graph_gui.c
+++ b/graph_gui.c
@@ -667,7 +667,7 @@ static void PerformanceRatingDetailWndProc(Window *w, WindowEvent *e)
if (p2->is_active)
UpdateCompanyRatingAndValue(p2, false);
- w->custom[0] = 74;
+ w->custom[0] = DAY_TICKS;
w->custom[1] = 5;
w->click_state = 1 << 13;
@@ -679,7 +679,7 @@ static void PerformanceRatingDetailWndProc(Window *w, WindowEvent *e)
{
// Update the player score every 5 days
if (--w->custom[0] == 0) {
- w->custom[0] = 74;
+ w->custom[0] = DAY_TICKS;
if (--w->custom[1] == 0) {
Player *p2;
w->custom[1] = 5;
diff --git a/players.c b/players.c
index 833f1dcf2..020b0d0f6 100644
--- a/players.c
+++ b/players.c
@@ -494,7 +494,7 @@ Player *DoStartupNewPlayer(bool is_ai)
void StartupPlayers()
{
// The AI starts like in the setting with +2 month max
- _next_competitor_start = _opt.diff.competitor_start_time * 90 * 74 + RandomRange(60 * 74) + 1;
+ _next_competitor_start = _opt.diff.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
}
static void MaybeStartNewPlayer()
@@ -513,7 +513,7 @@ static void MaybeStartNewPlayer()
DoStartupNewPlayer(true);
// The next AI starts like the difficulty setting said, with +2 month max
- _next_competitor_start = _opt.diff.competitor_start_time * 90 * 74 + RandomRange(60 * 74) + 1;
+ _next_competitor_start = _opt.diff.competitor_start_time * 90 * DAY_TICKS + RandomRange(60 * DAY_TICKS) + 1;
}
void InitializePlayers()