- if self.thing.carrying.type_ == 'Bottle' and self.thing.carrying.full:
- for t in [t for t in self.thing.game.things
- if t.type_ == 'BottleDeposit'
- and t.position == target_position]:
- raise PlayError('cannot drop full bottle into bottle deposit')
+ targets = [t for t in self.thing.game.things
+ if t.position == target_position
+ and not t == self.thing.carrying]
+ for target in targets:
+ if target.type_ == 'CookieSpawner' and\
+ not self.thing.carrying.cookable:
+ raise PlayError('cannot cook items of this type')
+ elif target.type_ == 'BottleDeposit':
+ if not self.thing.carrying.type_ == 'Bottle':
+ raise PlayError('cannot only put bottle into bottle deposit')
+ if self.thing.carrying.full:
+ raise PlayError('cannot drop full '
+ 'bottle into bottle deposit')
+ elif target.type_ == 'Crate' and\
+ self.thing.carrying.type_ == 'Crate':
+ raise PlayError('cannot put crate into crate')