(svn r12180) -Fix: Test purchase list loading/loaded sprites instead of unconditionally returning a possibly non-existant sprite.

This commit is contained in:
peter1138 2008-02-18 19:20:37 +00:00
parent 509b3a3247
commit a4c14fb442
1 changed files with 5 additions and 1 deletions

View File

@ -765,7 +765,11 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const
uint totalsets;
uint set;
if (v == NULL) return group->g.real.loading[0];
if (v == NULL) {
if (group->g.real.num_loading > 0) return group->g.real.loading[0];
if (group->g.real.num_loaded > 0) return group->g.real.loaded[0];
return NULL;
}
bool in_motion = v->First()->current_order.type != OT_LOADING;