From b8f6d41418982163965dd5beb0b39dbdce1fbe8f Mon Sep 17 00:00:00 2001 From: truelight Date: Sat, 4 Dec 2004 17:54:56 +0000 Subject: (svn r942) -Merged branch/network back into the trunk --- ai_new.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ai_new.c') diff --git a/ai_new.c b/ai_new.c index e651a87f1..a2d694d66 100644 --- a/ai_new.c +++ b/ai_new.c @@ -830,7 +830,7 @@ static int AiNew_HowManyVehicles(Player *p) { tiles_a_day = RoadVehInfo(i)->max_speed * 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; + amount = length * 2 * 2 / tiles_a_day / 30; if (amount == 0) amount = 1; return amount; } else if (p->ainew.tbt == AI_TRUCK) { @@ -853,7 +853,7 @@ static int AiNew_HowManyVehicles(Player *p) { // We want all the cargo to be gone in a month.. so, we know the cargo it delivers // we know what the vehicle takes with him, and we know the time it takes him // to get back here.. now let's do some math! - amount = (int)(((float)length / (float)tiles_a_day / 30 * 2) * ((float)max_cargo / (float)RoadVehInfo(i)->capacity)); + amount = 2 * length * max_cargo / tiles_a_day / 30 / RoadVehInfo(i)->capacity; amount += 1; return amount; } else { -- cgit v1.2.3-54-g00ecf