summaryrefslogtreecommitdiff
path: root/engine.c
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-27 21:34:31 +0000
committerhackykid <hackykid@openttd.org>2005-06-27 21:34:31 +0000
commit77d99eb807b378fcfe0424d5c6f27ec47b9a7b3d (patch)
treedf82715b2a2f8d161633b49238659e253c0f6c07 /engine.c
parentf81766c3fd741c3772a8b289e94a4362056f9938 (diff)
downloadopenttd-77d99eb807b378fcfe0424d5c6f27ec47b9a7b3d.tar.xz
(svn r2494) - Fix: [newgrf] Dont assume a spriteset can only have 4 or 8 sprites.
Diffstat (limited to 'engine.c')
-rw-r--r--engine.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/engine.c b/engine.c
index 671427e3c..65f016eda 100644
--- a/engine.c
+++ b/engine.c
@@ -563,9 +563,8 @@ int GetCustomEngineSprite(byte engine, const Vehicle *v, byte direction)
return 0;
}
- direction %= 8;
- if (rsg->sprites_per_set == 4)
- direction %= 4;
+ assert(rsg->sprites_per_set <= 8);
+ direction %= rsg->sprites_per_set;
totalsets = in_motion ? rsg->loaded_count : rsg->loading_count;