summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-05-04 22:32:25 +0000
committerglx <glx@openttd.org>2008-05-04 22:32:25 +0000
commit9eb498eb5397d46b8a16eb59626900ebd1af2dc2 (patch)
treea53051430449f2812dfac807865c7e6597464185
parenta51e32376eda7c62de0b70d3771324dec6afbbc0 (diff)
downloadopenttd-9eb498eb5397d46b8a16eb59626900ebd1af2dc2.tar.xz
(svn r12947) -Fix: keep only first 15 bits for non failed callback results
-rw-r--r--src/newgrf_spritegroup.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp
index b8103ae02..989ee2034 100644
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -204,6 +204,7 @@ static inline const SpriteGroup *ResolveVariable(const SpriteGroup *group, Resol
if (group->g.determ.num_ranges == 0) {
/* nvar == 0 is a special case -- we turn our value into a callback result */
+ if (value != CALLBACK_FAILED) value = GB(value, 0, 15);
nvarzero.type = SGT_CALLBACK;
nvarzero.g.callback.result = value;
return &nvarzero;