changeset 5922:2ab303172d09 draft

(svn r8550) -Fix Building a vehicle does not involve allocating orders, so do not check whether orders could be allocated
author tron <tron@openttd.org>
date Sat, 03 Feb 2007 09:05:43 +0000
parents 9d251365258e
children 6e3ace7b5646
files src/aircraft_cmd.cpp src/order.h src/order_cmd.cpp src/roadveh_cmd.cpp src/ship_cmd.cpp src/train_cmd.cpp
diffstat 6 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -230,8 +230,7 @@
 
 	/* Allocate 2 or 3 vehicle structs, depending on type
 	 * vl[0] = aircraft, vl[1] = shadow, [vl[2] = rotor] */
-	if (!AllocateVehicles(vl, avi->subtype & AIR_CTOL ? 2 : 3) ||
-			IsOrderPoolFull()) {
+	if (!AllocateVehicles(vl, avi->subtype & AIR_CTOL ? 2 : 3)) {
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 	}
 
--- a/src/order.h
+++ b/src/order.h
@@ -167,10 +167,6 @@
 	return false;
 }
 
-static inline bool IsOrderPoolFull(void)
-{
-	return !HasOrderPoolFree(1);
-}
 
 /* Pack and unpack routines */
 
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -337,7 +337,7 @@
 
 	if (sel_ord > v->num_orders) return CMD_ERROR;
 
-	if (IsOrderPoolFull()) return_cmd_error(STR_8831_NO_MORE_SPACE_FOR_ORDERS);
+	if (!HasOrderPoolFree(1)) return_cmd_error(STR_8831_NO_MORE_SPACE_FOR_ORDERS);
 
 	/* XXX - This limit is only here because the backuppedorders can't
 	 * handle any more then this.. */
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -128,8 +128,7 @@
 	if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
 
 	v = AllocateVehicle();
-	if (v == NULL || IsOrderPoolFull())
-		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
+	if (v == NULL) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
 	/* find the first free roadveh id */
 	unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_Road);
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -835,7 +835,7 @@
 	v = AllocateVehicle();
 	unit_num = HASBIT(p2, 0) ? 0 : GetFreeUnitNumber(VEH_Ship);
 
-	if (v == NULL || IsOrderPoolFull() || unit_num > _patches.max_ships)
+	if (v == NULL || unit_num > _patches.max_ships)
 		return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
 	if (flags & DC_EXEC) {
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -776,7 +776,7 @@
 
 		memset(&vl, 0, sizeof(vl));
 
-		if (!AllocateVehicles(vl, num_vehicles) || IsOrderPoolFull())
+		if (!AllocateVehicles(vl, num_vehicles))
 			return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);
 
 		v = vl[0];