(svn r8550) -Fix
authortron
Sat, 03 Feb 2007 09:05:43 +0000
changeset 5922 caa040c9e25d
parent 5921 7799711a9a23
child 5923 191acaa01499
(svn r8550) -Fix

Building a vehicle does not involve allocating orders, so do not check whether orders could be allocated
src/aircraft_cmd.cpp
src/order.h
src/order_cmd.cpp
src/roadveh_cmd.cpp
src/ship_cmd.cpp
src/train_cmd.cpp
--- a/src/aircraft_cmd.cpp	Sat Feb 03 08:30:22 2007 +0000
+++ b/src/aircraft_cmd.cpp	Sat Feb 03 09:05:43 2007 +0000
@@ -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	Sat Feb 03 08:30:22 2007 +0000
+++ b/src/order.h	Sat Feb 03 09:05:43 2007 +0000
@@ -167,10 +167,6 @@
 	return false;
 }
 
-static inline bool IsOrderPoolFull(void)
-{
-	return !HasOrderPoolFree(1);
-}
 
 /* Pack and unpack routines */
 
--- a/src/order_cmd.cpp	Sat Feb 03 08:30:22 2007 +0000
+++ b/src/order_cmd.cpp	Sat Feb 03 09:05:43 2007 +0000
@@ -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	Sat Feb 03 08:30:22 2007 +0000
+++ b/src/roadveh_cmd.cpp	Sat Feb 03 09:05:43 2007 +0000
@@ -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	Sat Feb 03 08:30:22 2007 +0000
+++ b/src/ship_cmd.cpp	Sat Feb 03 09:05:43 2007 +0000
@@ -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	Sat Feb 03 08:30:22 2007 +0000
+++ b/src/train_cmd.cpp	Sat Feb 03 09:05:43 2007 +0000
@@ -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];