# HG changeset patch # User Neil Muller # Date 1336660637 -7200 # Node ID 6a847f22a312729e6079d6df59165eb0673e4cd1 # Parent 591a85a4edace58753fe682b4c6009fd1ccc0e80 Don't restore selections if they're illegal diff -r 591a85a4edac -r 6a847f22a312 gamelib/gamegui.py --- a/gamelib/gamegui.py Thu May 10 13:16:25 2012 +0200 +++ b/gamelib/gamegui.py Thu May 10 16:37:17 2012 +0200 @@ -132,9 +132,11 @@ def restore_selection(self, old_selection): points = old_selection.count(self.science) # We skip things we cannot allocate enoigh points to (temp points - # boosts, etc.) + # boosts, etc.) or we cannot currently develop further if (points != self.points and - points <= self.parent.game.get_available_points()): + points <= self.parent.game.get_available_points() and + self.science.can_spend(self.parent.game.lab, + self.points + points)): self.points = points self.parent.game.cur_allocation.extend([self.science] * points) self.parent.update_labels()