(svn r15592) -Fix: Refit-info in purchase list did only check the first articulated part.

This commit is contained in:
frosch
2009-02-27 20:40:39 +00:00
parent 7299728472
commit e01106f66b
5 changed files with 51 additions and 18 deletions

View File

@@ -29,6 +29,7 @@
#include "timetable.h"
#include "vehiclelist.h"
#include "settings_type.h"
#include "articulated_vehicles.h"
#include "table/sprites.h"
#include "table/strings.h"
@@ -447,7 +448,7 @@ uint ShowAdditionalText(int x, int y, uint w, EngineID engine)
uint ShowRefitOptionsList(int x, int y, uint w, EngineID engine)
{
/* List of cargo types of this engine */
uint32 cmask = EngInfo(engine)->refit_mask;
uint32 cmask = GetUnionOfArticulatedRefitMasks(engine, GetEngine(engine)->type, false);
/* List of cargo types available in this climate */
uint32 lmask = _cargo_mask;
char string[512];
@@ -1667,9 +1668,6 @@ static bool IsVehicleRefitable(const Vehicle *v)
if (!v->IsStoppedInDepot()) return false;
do {
/* Skip this vehicle if it has no capacity */
if (v->cargo_cap == 0) continue;
if (IsEngineRefittable(v->engine_type)) return true;
} while ((v->type == VEH_TRAIN || v->type == VEH_ROAD) && (v = v->Next()) != NULL);