Fixes crash when can't copy file when generating fusion icon

This commit is contained in:
infinitefusion
2023-07-11 19:53:55 -04:00
parent e663541a88
commit e7778b72b9
17 changed files with 72 additions and 79 deletions

View File

@@ -191,8 +191,8 @@ class PokemonIconSprite < SpriteWrapper
bitmapFileName = sprintf("Graphics/Pokemon/FusionIcons/icon%03d", dexNum)
headPokeFileName = GameData::Species.icon_filename(headPoke)
bitmapPath = sprintf("%s.png", bitmapFileName)
IO.copy_stream(headPokeFileName, bitmapPath)
result_icon = AnimatedBitmap.new(bitmapPath)
generated_new_icon = generateFusionIcon(headPokeFileName,bitmapPath)
result_icon = generated_new_icon ? AnimatedBitmap.new(bitmapPath) : icon1
for i in 0..icon1.width-1
for j in ((icon1.height / 2) + Settings::FUSION_ICON_SPRITE_OFFSET)..icon1.height-1