forked from mirror/OpenTTD
(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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user