summaryrefslogtreecommitdiff
path: root/aircraft_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-11-05 14:01:00 +0000
committerbjarni <bjarni@openttd.org>2005-11-05 14:01:00 +0000
commitd86829d0e09fd981cc65c85d65f75129f9299b8f (patch)
tree1a3529cb495112b582023d8dc1ab63541d00c9dc /aircraft_cmd.c
parent7d4d13df3519d6db4b324b132c32325d25f7f5c3 (diff)
downloadopenttd-d86829d0e09fd981cc65c85d65f75129f9299b8f.tar.xz
(svn r3138) -Fix: [clone vehicles] fixed assert when it was possible to allocate some vehicles to clone a train, but not for all cars
Now it gives "too many vehicles" error message instead To make this work, AllocateVehicles() needed to be moved to vehicle.c (from aircraft_cmd.c) and made non-static
Diffstat (limited to 'aircraft_cmd.c')
-rw-r--r--aircraft_cmd.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index 2478a8e10..f096b92d4 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -121,29 +121,6 @@ void DrawAircraftEngine(int x, int y, EngineID engine, uint32 image_ormod)
}
}
-/* Allocate many vehicles */
-static bool AllocateVehicles(Vehicle **vl, int num)
-{
- int i;
- Vehicle *v;
- bool success = true;
-
- for(i=0; i!=num; i++) {
- vl[i] = v = AllocateVehicle();
- if (v == NULL) {
- success = false;
- break;
- }
- v->type = 1;
- }
-
- while (--i >= 0) {
- vl[i]->type = 0;
- }
-
- return success;
-}
-
int32 EstimateAircraftCost(EngineID engine_type)
{
return AircraftVehInfo(engine_type)->base_cost * (_price.aircraft_base>>3)>>5;