summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf_spritegroup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp
index 97e0114e2..69c286459 100644
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -144,7 +144,8 @@ static inline const SpriteGroup *ResolveVariable(const SpriteGroup *group, Resol
/* Try to get the variable. We shall assume it is available, unless told otherwise. */
bool available = true;
if (adjust->variable == 0x7E) {
- const SpriteGroup *subgroup = Resolve(adjust->subroutine, object);
+ ResolverObject subobject = *object;
+ const SpriteGroup *subgroup = Resolve(adjust->subroutine, &subobject);
if (subgroup == NULL || subgroup->type != SGT_CALLBACK) {
value = CALLBACK_FAILED;
} else {