summaryrefslogtreecommitdiff
path: root/src/order.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-01 22:10:54 +0000
committerrubidium <rubidium@openttd.org>2007-08-01 22:10:54 +0000
commit0ab03b835ba3908f7b31a2b701cb722f30862691 (patch)
treee6ac6f2443373cc3523acedc8b0e458b99955651 /src/order.h
parentcbd3aca30cb938081ae5a6dd498633e85665f591 (diff)
downloadopenttd-0ab03b835ba3908f7b31a2b701cb722f30862691.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.h8
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;
}