(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 4a329de942
commit 1ba2ae69e6

View File

@@ -765,7 +765,11 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const
uint totalsets; uint totalsets;
uint set; 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; bool in_motion = v->First()->current_order.type != OT_LOADING;