(svn r15399) -Fix [FS#2617]: For articulated parts v->cargo_type == CT_INVALID is possible.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
frosch 16 years ago
parent 9702edb554
commit 769573d1e9

@ -845,6 +845,12 @@ static const SpriteGroup *GetVehicleSpriteGroup(EngineID engine, const Vehicle *
const Engine *e = GetEngine(engine);
/* Engines are not available, when their cargo is not available.
* But that does not apply to articulated parts. */
if (cargo == CT_INVALID) cargo = CT_DEFAULT;
assert(cargo < lengthof(e->group));
group = e->group[cargo];
if (group != NULL) return group;

Loading…
Cancel
Save