Ensure that sprite data is cleared when loading over an existing sprite
Fixes crash when looking at recolour sprite in sprite viewer window which has been overriden by a non-recolour sprite by a faulty GRF
This commit is contained in:
@@ -727,6 +727,8 @@ bool LoadNextSprite(int load_index, SpriteFile &file, uint file_sprite_id)
|
|||||||
if (data != nullptr) {
|
if (data != nullptr) {
|
||||||
assert(data == _last_sprite_allocation.GetPtr());
|
assert(data == _last_sprite_allocation.GetPtr());
|
||||||
sc->buffer = std::move(_last_sprite_allocation);
|
sc->buffer = std::move(_last_sprite_allocation);
|
||||||
|
} else {
|
||||||
|
sc->buffer.Clear();
|
||||||
}
|
}
|
||||||
sc->lru = 0;
|
sc->lru = 0;
|
||||||
sc->id = file_sprite_id;
|
sc->id = file_sprite_id;
|
||||||
|
Reference in New Issue
Block a user