diff options
author | truelight <truelight@openttd.org> | 2004-12-04 17:54:56 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2004-12-04 17:54:56 +0000 |
commit | b8f6d41418982163965dd5beb0b39dbdce1fbe8f (patch) | |
tree | 68d3e795694a875138c369707ed74b5b4b022d49 /ai_new.c | |
parent | 0434287ef826a4ed72cd8528a52a86ae8b70a948 (diff) | |
download | openttd-b8f6d41418982163965dd5beb0b39dbdce1fbe8f.tar.xz |
(svn r942) -Merged branch/network back into the trunk
Diffstat (limited to 'ai_new.c')
-rw-r--r-- | ai_new.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 { |