forked from mirror/OpenTTD
(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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user