summaryrefslogtreecommitdiff
path: root/ai_new.c
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 /ai_new.c
parentbf0652d3fce57024fe56f75d43898a261fea7570 (diff)
downloadopenttd-aa0212515882c5a90c3f2cb86f05952b832a5a9f.tar.xz
(svn r166) -Codechange: change 74 for constant DAY_TICKS
Diffstat (limited to 'ai_new.c')
-rw-r--r--ai_new.c7
1 files changed, 3 insertions, 4 deletions
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