Skip to content

Commit

Permalink
Fixed a minor bug in the level up screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelovesrobots committed Jul 14, 2011
1 parent 9fadbab commit 7803a29
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions level_up_screen.lua
Expand Up @@ -73,8 +73,15 @@ function LevelUpScreen:reset_menu()

self.title = self.base_part.name

self.menu = table.dup(self.base_part.contains)
table.each(self.base_part.unlocks, function (name)
self.menu = {}

table.each(self.base_part.contains, function (part)
if table.length(part.unlocks) then
table.push(self.menu, part)
end
end)

table.each(self.base_part.unlocks, function (name)
local installed_names = table.collect(self.base_part.contains, function(x) return x.name end)
if not table.includes(installed_names, name) then
table.push(self.menu, create_monster_part(name))
Expand Down

0 comments on commit 7803a29

Please sign in to comment.