diff options
author | rubidium <rubidium@openttd.org> | 2007-08-01 22:10:54 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-01 22:10:54 +0000 |
commit | 4e96ce3dfea13ffab951a93061e35423e0b321e5 (patch) | |
tree | e6ac6f2443373cc3523acedc8b0e458b99955651 /src/order.h | |
parent | 435d39f8fb5c2e3a40e6e0c7344ba4b1531a6844 (diff) | |
download | openttd-4e96ce3dfea13ffab951a93061e35423e0b321e5.tar.xz |
(svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.
Diffstat (limited to 'src/order.h')
-rw-r--r-- | src/order.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/order.h b/src/order.h index 9703989e8..30d59517c 100644 --- a/src/order.h +++ b/src/order.h @@ -171,13 +171,9 @@ static inline bool HasOrderPoolFree(uint amount) const Order *order; /* There is always room if not all blocks in the pool are reserved */ - if (_Order_pool.current_blocks < _Order_pool.max_blocks) - return true; + if (_Order_pool.CanAllocateMoreBlocks()) return true; - FOR_ALL_ORDERS(order) - if (!order->IsValid()) - if (--amount == 0) - return true; + FOR_ALL_ORDERS(order) if (!order->IsValid() && --amount == 0) return true; return false; } |