1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 04:04:09 +01:00

Codechange: Simplify usage of GRFFileProps by adding some common helper methods.

This commit is contained in:
frosch
2025-04-26 21:18:07 +02:00
committed by frosch
parent 46494c6d44
commit b7e7f08f78
12 changed files with 67 additions and 17 deletions

View File

@@ -386,8 +386,7 @@ ObjectResolverObject::ObjectResolverObject(const ObjectSpec *spec, Object *obj,
CallbackID callback, uint32_t param1, uint32_t param2)
: ResolverObject(spec->grf_prop.grffile, callback, param1, param2), object_scope(*this, obj, spec, tile, view)
{
this->root_spritegroup = (obj == nullptr) ? spec->grf_prop.GetSpriteGroup(StandardSpriteGroup::Purchase) : nullptr;
if (this->root_spritegroup == nullptr) this->root_spritegroup = spec->grf_prop.GetSpriteGroup(StandardSpriteGroup::Default);
this->root_spritegroup = spec->grf_prop.GetSpriteGroup(obj != nullptr);
}
/**