More Rubocop changes

This commit is contained in:
Maruno17
2022-02-13 00:57:54 +00:00
parent cca5989746
commit f68e699cc9
108 changed files with 708 additions and 808 deletions

View File

@@ -88,11 +88,10 @@ class Battle::Scene
shouldCompact = false
@animations.each_with_index do |a, i|
a.update
if a.animDone?
a.dispose
@animations[i] = nil
shouldCompact = true
end
next if !a.animDone?
a.dispose
@animations[i] = nil
shouldCompact = true
end
@animations.compact! if shouldCompact
end

View File

@@ -195,8 +195,8 @@ class Battle::Scene
# Set Bag starting positions
oldLastPocket = $bag.last_viewed_pocket
oldChoices = $bag.last_pocket_selections.clone
$bag.last_viewed_pocket = @bagLastPocket if @bagLastPocket != nil
$bag.last_pocket_selections = @bagChoices if @bagChoices != nil
$bag.last_viewed_pocket = @bagLastPocket if @bagLastPocket
$bag.last_pocket_selections = @bagChoices if @bagChoices
# Start Bag screen
itemScene = PokemonBag_Scene.new
itemScene.pbStartScene($bag, true,

View File

@@ -137,7 +137,7 @@ class Battle::Scene
a[2] = true if a[1].animDone?
end
pbUpdate
if !inPartyAnimation? && !sendOutAnims.any? { |a| !a[2] }
if !inPartyAnimation? && sendOutAnims.none? { |a| !a[2] }
break
end
end
@@ -515,7 +515,7 @@ class Battle::Scene
return if !animations
animations.each do |a|
next if !a || a.name != "Common:" + animName
pbAnimationCore(a, user, (target != nil) ? target : user)
pbAnimationCore(a, user, target || user)
return
end
end

View File

@@ -174,9 +174,7 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
@msgBox.text = value[0]
return if USE_GRAPHICS
commands = []
(1..4).each do |i|
commands.push(value[i]) if value[i] && value[i] != nil
end
(1..4).each { |i| commands.push(value[i]) if value[i] }
@cmdWindow.commands = commands
end