diff options
author | rubidium <rubidium@openttd.org> | 2007-05-19 09:40:18 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-19 09:40:18 +0000 |
commit | 7d4be11516e2ef80bcce2a61f08d1cf091401ef1 (patch) | |
tree | fcea59953bd1ce2ff5f0302669d3649bf7ca78bb /src/openttd.cpp | |
parent | 816d31f0aac2612ab1b076c5a99480b7534242ae (diff) | |
download | openttd-7d4be11516e2ef80bcce2a61f08d1cf091401ef1.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.cpp | 16 |
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; } |