1
0
Fork 0

Codefix: Don't look up NewGRF Action 6-modified data twice. (#13863)

pull/13857/head
Peter Nelson 2025-03-21 18:13:31 +00:00 committed by GitHub
parent a4f3ddae5f
commit e47082bf7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -9860,16 +9860,14 @@ static void DecodeSpecialSprite(uint8_t *buf, uint num, GrfLoadingStage stage)
/* 0x14 */ { StaticGRFInfo, nullptr, nullptr, nullptr, nullptr, nullptr, },
};
GRFLocation location(_cur.grfconfig->ident.grfid, _cur.nfo_line);
GRFLineToSpriteOverride::iterator it = _grf_line_to_action6_sprite_override.find(location);
auto it = _grf_line_to_action6_sprite_override.find({_cur.grfconfig->ident.grfid, _cur.nfo_line});
if (it == _grf_line_to_action6_sprite_override.end()) {
/* No preloaded sprite to work with; read the
* pseudo sprite content. */
_cur.file->ReadBlock(buf, num);
} else {
/* Use the preloaded sprite data. */
buf = _grf_line_to_action6_sprite_override[location].data();
buf = it->second.data();
GrfMsg(7, "DecodeSpecialSprite: Using preloaded pseudo sprite data");
/* Skip the real (original) content of this action. */