Codechange: Move SpriteGroup cast from callers into Resolve.

This commit is contained in:
frosch
2025-04-28 15:58:35 +02:00
committed by frosch
parent af25eecc15
commit 010b944173
15 changed files with 59 additions and 50 deletions
+2 -3
View File
@@ -629,9 +629,8 @@ void IndustryProductionCallback(Industry *ind, int reason)
}
SB(object.callback_param2, 8, 16, loop);
const SpriteGroup *tgroup = object.Resolve();
if (tgroup == nullptr || tgroup->type != SGT_INDUSTRY_PRODUCTION) break;
const IndustryProductionSpriteGroup *group = (const IndustryProductionSpriteGroup *)tgroup;
const auto *group = object.Resolve<IndustryProductionSpriteGroup>();
if (group == nullptr) break;
if (group->version == 0xFF) {
/* Result was marked invalid on load, display error message */