summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-19 09:40:18 +0000
committerrubidium <rubidium@openttd.org>2007-05-19 09:40:18 +0000
commit8f0f090c5139465bb2db1bf280886a563a68385d (patch)
treefcea59953bd1ce2ff5f0302669d3649bf7ca78bb /src/openttd.cpp
parent9a4b4ba4484112c7eefa6ed134ec4d725be7d2a7 (diff)
downloadopenttd-8f0f090c5139465bb2db1bf280886a563a68385d.tar.xz
(svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index a2bb58b43..b4353612b 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -63,6 +63,7 @@
#include "newgrf_house.h"
#include "newgrf_commons.h"
#include "player_face.h"
+#include "group.h"
#include "bridge_map.h"
#include "clear_map.h"
@@ -294,6 +295,7 @@ static void UnInitializeGame()
CleanPool(&_Vehicle_pool);
CleanPool(&_Sign_pool);
CleanPool(&_Order_pool);
+ CleanPool(&_Group_pool);
free((void*)_town_sort);
free((void*)_industry_sort);
@@ -1954,6 +1956,20 @@ bool AfterLoadGame()
_opt.diff.number_towns++;
}
+ /* Recalculate */
+ Group *g;
+ FOR_ALL_GROUPS(g) {
+ const Vehicle *v;
+ FOR_ALL_VEHICLES(v) {
+ if (!IsEngineCountable(v)) continue;
+
+ if (v->group_id != g->index || v->type != g->vehicle_type || v->owner != g->owner) continue;
+
+ g->num_engines[v->engine_type]++;
+ }
+ }
+
+
return true;
}