Fixed replacement battler being invisible if its predecessor fainted and used the same sprite, refactoring

This commit is contained in:
Maruno17
2024-04-01 23:41:54 +01:00
parent a2af2c36f9
commit 494e646fd5
6 changed files with 64 additions and 84 deletions

View File

@@ -312,6 +312,7 @@ class Battle::Scene
#=============================================================================
def pbFaintBattler(battler)
@briefMessage = false
old_height = @sprites["pokemon_#{battler.index}"].src_rect.height
# Pokémon plays cry and drops down, data box disappears
faintAnim = Animation::BattlerFaint.new(@sprites, @viewport, battler.index, @battle)
dataBoxAnim = Animation::DataBoxDisappear.new(@sprites, @viewport, battler.index)
@@ -323,6 +324,7 @@ class Battle::Scene
end
faintAnim.dispose
dataBoxAnim.dispose
@sprites["pokemon_#{battler.index}"].src_rect.height = old_height
end
#=============================================================================