X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=new%2Fplomrogue%2Fthings.py;h=8900d9a983d751490b7b0d84f0802d9b2efae1ec;hb=9b52804b9f869b48a54e53ab0cea4cc0fd4a0e74;hp=797fd6bce2ea347e13502670d5ab0bcad654bcfd;hpb=569bb0b9683cfd5db1fa100e49127fe84b39f0ac;p=plomrogue2-experiments diff --git a/new/plomrogue/things.py b/new/plomrogue/things.py index 797fd6b..8900d9a 100644 --- a/new/plomrogue/things.py +++ b/new/plomrogue/things.py @@ -51,7 +51,7 @@ class Thing(ThingBase): def _position_set(self, pos): super()._position_set(pos) for t_id in self.inventory: - t = self.game.get_thing(t_id) + t = self.game.get_thing(t_id, create_unfound=False) t.position = self.position if not self.id_ == self.game.player_id: return @@ -187,12 +187,12 @@ class ThingAnimate(Thing): def hunt_food_satisfaction(self): for id_ in self.inventory: - t = self.game.get_thing(id_) + t = self.game.get_thing(id_, create_unfound=False) if t.type_ == 'food': self.set_task('EAT', (id_,)) return True for id_ in self.get_pickable_items(): - t = self.game.get_thing(id_) + t = self.game.get_thing(id_, create_unfound=False) if t.type_ == 'food': self.set_task('PICKUP', (id_,)) return True @@ -246,6 +246,7 @@ class ThingAnimate(Thing): if self is self.game.player: self.game.player_is_alive = False else: + # TODO: Handle inventory. del self.game.things[self.game.things.index(self)] return try: