summaryrefslogtreecommitdiff
path: root/src/newgrf_spritegroup.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2018-03-11 15:08:51 +0000
committerfrosch <frosch@openttd.org>2018-03-11 15:08:51 +0000
commit55a503e6f225a3c1dba3dbc1effa7e0d6942dd96 (patch)
treec60b80c025c69edbfa919518d81b84c354fcbe7f /src/newgrf_spritegroup.cpp
parentc6eb633d189f12fa3dd95243a5dcc021cb0e930b (diff)
downloadopenttd-55a503e6f225a3c1dba3dbc1effa7e0d6942dd96.tar.xz
(svn r27989) -Fix (r27985): VA2 optimisation failed in various special cases:
- nvar=0 is meant to return the calculated result. - Missing references resolve to NULL and got identified with the default result. - Missing 'break' broke overlapping cases. - Splitting into non-overlapping cases could result in more than 256 cases.
Diffstat (limited to 'src/newgrf_spritegroup.cpp')
-rw-r--r--src/newgrf_spritegroup.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp
index 8f44ef9c5..a5d689bbf 100644
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -252,7 +252,7 @@ const SpriteGroup *DeterministicSpriteGroup::Resolve(ResolverObject &object) con
object.last_value = last_value;
- if (this->num_ranges == 0) {
+ if (this->calculated_result) {
/* nvar == 0 is a special case -- we turn our value into a callback result */
if (value != CALLBACK_FAILED) value = GB(value, 0, 15);
static CallbackResultSpriteGroup nvarzero(0, true);