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

This commit is contained in:
peter1138 2008-01-04 13:40:23 +00:00
parent 3182cbb332
commit 1cd2c3d517
1 changed files with 1 additions and 1 deletions

View File

@ -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;