Prevent NewGRFs from using Action A to replace internal sprites

This commit is contained in:
Jonathan G Rennison
2022-01-17 18:23:15 +00:00
parent 027a792cbd
commit 1a4b0d6ecf
2 changed files with 12 additions and 1 deletions

View File

@@ -705,6 +705,11 @@ bool LoadNextSprite(int load_index, SpriteFile &file, uint file_sprite_id)
if (type == ST_INVALID) return false;
if (load_index == -1) {
if (data != nullptr) _last_sprite_allocation.Clear();
return false;
}
if (load_index >= MAX_SPRITES) {
usererror("Tried to load too many sprites (#%d; max %d)", load_index, MAX_SPRITES);
}