summaryrefslogtreecommitdiff
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
commitfc43b1ba0987afce993d74bd5f092e4a275c8616 (patch)
treedf82715b2a2f8d161633b49238659e253c0f6c07
parentb38358f8b73431087f638cc3fdeceb9ca0861475 (diff)
downloadopenttd-fc43b1ba0987afce993d74bd5f092e4a275c8616.tar.xz
(svn r2494) - Fix: [newgrf] Dont assume a spriteset can only have 4 or 8 sprites.
-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;