mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Fixed the Bag lists having incorrect starting positions when choosing an item from a subset of your Bag
This commit is contained in:
@@ -16,17 +16,19 @@ class PokemonBag
|
||||
end
|
||||
|
||||
def initialize
|
||||
@last_viewed_pocket = 1
|
||||
@pockets = []
|
||||
@last_pocket_selections = []
|
||||
(0..PokemonBag.pocket_count).each do |i|
|
||||
@pockets[i] = []
|
||||
@last_pocket_selections[i] = 0
|
||||
end
|
||||
@pockets = []
|
||||
(0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] }
|
||||
reset_last_selections
|
||||
@registered_items = []
|
||||
@ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
|
||||
end
|
||||
|
||||
def reset_last_selections
|
||||
@last_viewed_pocket = 1
|
||||
@last_pocket_selections ||= []
|
||||
(0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 }
|
||||
end
|
||||
|
||||
def clear
|
||||
@pockets.each { |pocket| pocket.clear }
|
||||
(PokemonBag.pocket_count + 1).times { |i| @last_pocket_selections[i] = 0 }
|
||||
|
||||
Reference in New Issue
Block a user