mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(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
7484eba2db
commit
c5f12c337d
@ -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
Block a user