mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20199) -Fix [FS#3964]: NewGRFs that defined a vehicle without either loaded or loading groups could crash OpenTTD
This commit is contained in:
parent
3e44b5e2e3
commit
5ac645ac1f
|
@ -841,6 +841,8 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const
|
|||
|
||||
uint totalsets = in_motion ? group->num_loaded : group->num_loading;
|
||||
|
||||
if (totalsets == 0) return NULL;
|
||||
|
||||
uint set = (v->cargo.Count() * totalsets) / max((uint16)1, v->cargo_cap);
|
||||
set = min(set, totalsets - 1);
|
||||
|
||||
|
|
Loading…
Reference in New Issue