# HG changeset patch # User KarstenBock@gmx.net # Date 1318181039 -7200 # Node ID fadc02e77ae1740d99d1d4846a44198910edc360 # Parent 2d671e57badb328c6c84e329472dc9803f4f742d get_equipable now checks if wearer is valid and returns None if it is not. This will fix a falsely raised SlotInvalidError. diff -r 2d671e57badb -r fadc02e77ae1 src/parpg/components/equip.py --- a/src/parpg/components/equip.py Sun Oct 09 18:22:48 2011 +0200 +++ b/src/parpg/components/equip.py Sun Oct 09 19:23:59 2011 +0200 @@ -21,6 +21,14 @@ def __init__(self): Base.__init__(self, head=object, neck=object, body=object, belt=object, leg=object, feet=object, l_arm=object, r_arm=object) + self.head = None + self.neck = None + self.body = None + self.belt = None + self.leg = None + self.feet = None + self.l_arm = None + self.r_arm = None @property def saveable_fields(self): @@ -76,6 +84,8 @@ def get_equipable(wearer, slot): """Return the equipable in the given slot""" + if not wearer: + return None try: item = getattr(wearer, slot) return item