(svn r11756) -Fix: Out of bounds access caused if a vehicle's cargo amount was higher than its capacity when resolving sprite groups.

pull/155/head
peter1138 17 years ago
parent 7f4a03d073
commit cb0e80fcb3

@ -803,7 +803,7 @@ static const SpriteGroup *VehicleResolveReal(const ResolverObject *object, const
totalsets = in_motion ? group->g.real.num_loaded : group->g.real.num_loading;
if (v->cargo.Count() == v->cargo_cap || totalsets == 1) {
if (v->cargo.Count() >= v->cargo_cap || totalsets == 1) {
set = totalsets - 1;
} else if (v->cargo.Empty() || totalsets == 2) {
set = 0;

Loading…
Cancel
Save