summaryrefslogtreecommitdiff
path: root/src/autoreplace_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-10-03 17:23:41 +0000
committerfrosch <frosch@openttd.org>2011-10-03 17:23:41 +0000
commitdd74536bef66a4e1d214caab38805d0c70acb075 (patch)
treeb63a5d705ca0f724802d0cc2363c99f52a1de70a /src/autoreplace_gui.cpp
parent5be8f732049daa97fd212ed9b91354d3b146d99d (diff)
downloadopenttd-dd74536bef66a4e1d214caab38805d0c70acb075.tar.xz
(svn r22981) -Add: GroupStatistics for the ALL_GROUP.
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r--src/autoreplace_gui.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index e95606494..6f29b6deb 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -74,10 +74,7 @@ static int CDECL EngineNumberSorter(const EngineID *a, const EngineID *b)
*/
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
{
- Company *c = Company::Get(_local_company);
- uint num_engines = GetGroupNumEngines(_local_company, id_g, e);
-
- if (num_engines == 0 || c->num_engines[e] == 0) {
+ if (GetGroupNumEngines(_local_company, id_g, e) || GetGroupNumEngines(_local_company, ALL_GROUP, e) == 0) {
/* We don't have any of this engine type.
* Either we just sold the last one, we build a new one or we stopped replacing it.
* In all cases, we need to update the left list */