diff src/parpg/components/equip.py @ 105:7829eb185d6f

(Re)added setting of inventory and equipment in the object files.
author KarstenBock@gmx.net
date Thu, 22 Sep 2011 16:18:07 +0200
parents 3d9b6405bd86
children 3564a46544bc
line wrap: on
line diff
--- a/src/parpg/components/equip.py	Thu Sep 22 14:39:00 2011 +0200
+++ b/src/parpg/components/equip.py	Thu Sep 22 16:18:07 2011 +0200
@@ -54,7 +54,7 @@
         raise AlreadyEquippedError
     if slot in equipable.possible_slots:
         try:
-            old_item = getattr(wearer, slot)
+            old_item = getattr(wearer, slot) if hasattr(wearer, slot) else None
             setattr(wearer, slot, equipable)
             equipable.in_slot = slot
             equipable.wearer = wearer