Mercurial > rinkhals
changeset 361:d2acf43aba6f
Don't go into debt when buying equipment in buildings
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Mon, 07 Sep 2009 11:34:06 +0000 |
parents | b4ead8d2b776 |
children | d1ff514fb6d4 |
files | gamelib/gameboard.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gameboard.py Mon Sep 07 11:20:52 2009 +0000 +++ b/gamelib/gameboard.py Mon Sep 07 11:34:06 2009 +0000 @@ -737,6 +737,8 @@ def do_equip(chicken, update_button=None): # Try to equip the chicken + if self.cash < equipment.buy_price(): + return False if equipment.place(chicken): self.add_cash(-equipment.buy_price()) chicken.equip(equipment) @@ -745,8 +747,6 @@ return False chicken = self.get_outside_chicken(tile_pos) - if self.cash < equipment.buy_price(): - return if chicken is None: building = self.get_building(tile_pos) if building is None: