mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Add an explicit enum member for the default spritegroup of badges.
parent
29ceaf0a84
commit
893aa0fb91
|
@ -92,6 +92,7 @@ enum GrfSpecFeature : uint8_t {
|
|||
GSF_BADGES,
|
||||
GSF_END,
|
||||
|
||||
GSF_DEFAULT = GSF_END, ///< Unspecified feature, default badge
|
||||
GSF_FAKE_TOWNS = GSF_END, ///< Fake town GrfSpecFeature for NewGRF debugging (parent scope)
|
||||
GSF_FAKE_END, ///< End of the fake features
|
||||
|
||||
|
|
|
@ -651,7 +651,7 @@ static void BadgeMapSpriteGroup(ByteReader &buf, uint8_t idcount)
|
|||
}
|
||||
|
||||
auto &badge = *GetBadge(found->second);
|
||||
badge.grf_prop.SetSpriteGroup(GSF_END, _cur_gps.spritegroups[groupid]);
|
||||
badge.grf_prop.SetSpriteGroup(GSF_DEFAULT, _cur_gps.spritegroups[groupid]);
|
||||
badge.grf_prop.SetGRFFile(_cur_gps.grffile);
|
||||
badge.grf_prop.local_id = local_id;
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ BadgeResolverObject::BadgeResolverObject(const Badge &badge, GrfSpecFeature feat
|
|||
{
|
||||
assert(feature <= GSF_END);
|
||||
this->root_spritegroup = this->self_scope.badge.grf_prop.GetSpriteGroup(feature);
|
||||
if (this->root_spritegroup == nullptr) this->root_spritegroup = this->self_scope.badge.grf_prop.GetSpriteGroup(GSF_END);
|
||||
if (this->root_spritegroup == nullptr) this->root_spritegroup = this->self_scope.badge.grf_prop.GetSpriteGroup(GSF_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue