diff gamelib/scenes/machine.py @ 750:ef4bda7d623d pyntnclick

Better state and inventory management.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 20 Jan 2013 20:20:36 +0200
parents 2f74064bc779
children c910c8b51d55
line wrap: on
line diff
--- a/gamelib/scenes/machine.py	Sun Jan 20 18:57:17 2013 +0200
+++ b/gamelib/scenes/machine.py	Sun Jan 20 20:20:36 2013 +0200
@@ -180,21 +180,21 @@
         else:
             welder_slot.set_data("contents", set())
             welder_slot.update_contents()
-            if self.game.items["cryo_pipes_one"] in self.game.inventory:
+            if self.game.is_in_inventory("cryo_pipes_one"):
                 self.game.replace_inventory_item("cryo_pipes_one",
                                                   "cryo_pipes_two")
                 return Result("With high-precision spitzensparken, you weld"
                               " together a second pipe. You bundle the two"
                               " pipes together.",
                         soundfile='laser.ogg')
-            elif self.game.items["cryo_pipes_two"] in self.game.inventory:
+            elif self.game.is_in_inventory("cryo_pipes_two"):
                 self.game.replace_inventory_item("cryo_pipes_two",
                                                   "cryo_pipes_three")
                 return Result("With high-precision spitzensparken, you create"
                               " yet another pipe. You store it with the other"
                               " two.",
                         soundfile='laser.ogg')
-            elif self.game.items["cryo_pipes_three"] in self.game.inventory:
+            elif self.game.is_in_inventory("cryo_pipes_three"):
                 # just for safety
                 return None
             else: