changeset 59:977224a5c663

Check can_spend in science button
author Neil Muller <drnlmuller@gmail.com>
date Mon, 07 May 2012 23:20:59 +0200
parents 52913ba12988
children f9d2ba74723d
files gamelib/gamegui.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/gamegui.py	Mon May 07 23:20:41 2012 +0200
+++ b/gamelib/gamegui.py	Mon May 07 23:20:59 2012 +0200
@@ -57,7 +57,8 @@
             science.points))
 
     def on_click(self):
-        if self.parent.available_points > 0:
+        if (self.parent.available_points > 0 and
+                self.science.can_spend(self.parent.game.lab, self.points + 1)):
             self.points += 1
             self.text = '%s: %d' % (self.science.NAME,
                     self.science.points + self.points)