summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-04 13:40:23 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-04 13:40:23 +0000
commit1cd2c3d517912c6b9ec04d526fc252dd4de24a7a (patch)
tree966e24604d9a1869f6cc3cb26de22a13ddc1a7d8 /src
parent3182cbb33210f7c783099d6d88acc12e0f29ef0b (diff)
downloadopenttd-1cd2c3d517912c6b9ec04d526fc252dd4de24a7a.tar.xz
(svn r11756) -Fix: Out of bounds access caused if a vehicle's cargo amount was higher than its capacity when resolving sprite groups.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index defa75ae9..a12d04ce4 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -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;