mirror of https://github.com/OpenTTD/OpenTTD
Codefix: Don't look up NewGRF Action 6-modified data twice. (#13863)
parent
a4f3ddae5f
commit
e47082bf7b
|
@ -9860,16 +9860,14 @@ static void DecodeSpecialSprite(uint8_t *buf, uint num, GrfLoadingStage stage)
|
||||||
/* 0x14 */ { StaticGRFInfo, nullptr, nullptr, nullptr, nullptr, nullptr, },
|
/* 0x14 */ { StaticGRFInfo, nullptr, nullptr, nullptr, nullptr, nullptr, },
|
||||||
};
|
};
|
||||||
|
|
||||||
GRFLocation location(_cur.grfconfig->ident.grfid, _cur.nfo_line);
|
auto it = _grf_line_to_action6_sprite_override.find({_cur.grfconfig->ident.grfid, _cur.nfo_line});
|
||||||
|
|
||||||
GRFLineToSpriteOverride::iterator it = _grf_line_to_action6_sprite_override.find(location);
|
|
||||||
if (it == _grf_line_to_action6_sprite_override.end()) {
|
if (it == _grf_line_to_action6_sprite_override.end()) {
|
||||||
/* No preloaded sprite to work with; read the
|
/* No preloaded sprite to work with; read the
|
||||||
* pseudo sprite content. */
|
* pseudo sprite content. */
|
||||||
_cur.file->ReadBlock(buf, num);
|
_cur.file->ReadBlock(buf, num);
|
||||||
} else {
|
} else {
|
||||||
/* Use the preloaded sprite data. */
|
/* 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");
|
GrfMsg(7, "DecodeSpecialSprite: Using preloaded pseudo sprite data");
|
||||||
|
|
||||||
/* Skip the real (original) content of this action. */
|
/* Skip the real (original) content of this action. */
|
||||||
|
|
Loading…
Reference in New Issue