# HG changeset patch # User KarstenBock@gmx.net # Date 1318181039 -7200 # Node ID fa5c769468f006b39e195de1ba2123e8cbaeafc0 # Parent c28e290562180dab8b639c6912d97ce8e50b918a get_equipable now checks if wearer is valid and returns None if it is not. This will fix a falsely raised SlotInvalidError. diff -r c28e29056218 -r fa5c769468f0 components/equip.py --- a/components/equip.py Sun Oct 09 18:22:48 2011 +0200 +++ b/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