(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.

This commit is contained in:
rubidium
2007-05-19 09:40:18 +00:00
parent 816d31f0aa
commit 7d4be11516
39 changed files with 1678 additions and 67 deletions

View File

@@ -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;
}