summaryrefslogtreecommitdiff
path: root/src/newgrf_generic.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-03-03 20:02:31 +0000
committerfrosch <frosch@openttd.org>2014-03-03 20:02:31 +0000
commit6b61c4608fab00c7bfc78c296b3c85f611681f59 (patch)
tree9919983ecf008602a497445b2b3e05b5c32892b8 /src/newgrf_generic.cpp
parentb935cb84156f18b51196288ff6d12f8ca5b26630 (diff)
downloadopenttd-6b61c4608fab00c7bfc78c296b3c85f611681f59.tar.xz
(svn r26388) -Codechange: Move resolving of Action 3 into ResolverObject constructor.
Diffstat (limited to 'src/newgrf_generic.cpp')
-rw-r--r--src/newgrf_generic.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf_generic.cpp b/src/newgrf_generic.cpp
index f1305636d..55eee6d23 100644
--- a/src/newgrf_generic.cpp
+++ b/src/newgrf_generic.cpp
@@ -179,17 +179,17 @@ static uint16 GetGenericCallbackResult(uint8 feature, ResolverObject &object, ui
/* Test each feature callback sprite group. */
for (GenericCallbackList::const_iterator it = _gcl[feature].begin(); it != _gcl[feature].end(); ++it) {
- const SpriteGroup *group = it->group;
object.grffile = it->file;
+ object.root_spritegroup = it->group;
/* Set callback param based on GRF version. */
object.callback_param1 = it->file->grf_version >= 8 ? param1_grfv8 : param1_grfv7;
- group = SpriteGroup::Resolve(group, object);
- if (group == NULL || group->GetCallbackResult() == CALLBACK_FAILED) continue;
+ uint16 result = object.ResolveCallback();
+ if (result == CALLBACK_FAILED) continue;
/* Return NewGRF file if necessary */
if (file != NULL) *file = it->file;
- return group->GetCallbackResult();
+ return result;
}
/* No callback returned a valid result, so we've failed. */