(svn r166) -Codechange: change 74 for constant DAY_TICKS
authordarkvater
Mon, 06 Sep 2004 18:22:25 +0000
changeset 165 f81fa8c27236
parent 164 0cbdf3c9bde1
child 166 683136f1e8a8
(svn r166) -Codechange: change 74 for constant DAY_TICKS
ai.h
ai_new.c
graph_gui.c
players.c
--- a/ai.h	Mon Sep 06 18:15:13 2004 +0000
+++ b/ai.h	Mon Sep 06 18:22:25 2004 +0000
@@ -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
--- a/ai_new.c	Mon Sep 06 18:15:13 2004 +0000
+++ b/ai_new.c	Mon Sep 06 18:22:25 2004 +0000
@@ -65,8 +65,7 @@
 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 @@
     	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 @@
     	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
--- a/graph_gui.c	Mon Sep 06 18:15:13 2004 +0000
+++ b/graph_gui.c	Mon Sep 06 18:22:25 2004 +0000
@@ -667,7 +667,7 @@
         		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 @@
         {
         	// 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;
--- a/players.c	Mon Sep 06 18:15:13 2004 +0000
+++ b/players.c	Mon Sep 06 18:22:25 2004 +0000
@@ -494,7 +494,7 @@
 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 @@
 		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()