From 9eb498eb5397d46b8a16eb59626900ebd1af2dc2 Mon Sep 17 00:00:00 2001 From: glx Date: Sun, 4 May 2008 22:32:25 +0000 Subject: (svn r12947) -Fix: keep only first 15 bits for non failed callback results --- src/newgrf_spritegroup.cpp | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3-70-g09d2