mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r8550) -Fix
Building a vehicle does not involve allocating orders, so do not check whether orders could be allocated
This commit is contained in:
parent
981833751a
commit
c326ff3795
|
@ -230,8 +230,7 @@ int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -167,10 +167,6 @@ static inline bool HasOrderPoolFree(uint amount)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline bool IsOrderPoolFull(void)
|
||||
{
|
||||
return !HasOrderPoolFree(1);
|
||||
}
|
||||
|
||||
/* Pack and unpack routines */
|
||||
|
||||
|
|
|
@ -337,7 +337,7 @@ int32 CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
|
||||
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.. */
|
||||
|
|
|
@ -128,8 +128,7 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
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);
|
||||
|
|
|
@ -835,7 +835,7 @@ int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
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) {
|
||||
|
|
|
@ -776,7 +776,7 @@ int32 CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue