diff options
author | glx <glx@openttd.org> | 2008-05-04 22:32:25 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-05-04 22:32:25 +0000 |
commit | 5b1e42388966958b1fb1451798e30c8f9e48c00b (patch) | |
tree | a53051430449f2812dfac807865c7e6597464185 | |
parent | cdf9ada59987fdc5dbac8faa1420f5234c194d30 (diff) | |
download | openttd-5b1e42388966958b1fb1451798e30c8f9e48c00b.tar.xz |
(svn r12947) -Fix: keep only first 15 bits for non failed callback results
-rw-r--r-- | src/newgrf_spritegroup.cpp | 1 |
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; |