comparison src/parpg/gamemodel.py @ 113:7b0846025412

Fixed bug in checkAttributes that caused that values where not correctly set from the Template.
author KarstenBock@gmx.net
date Fri, 23 Sep 2011 14:43:06 +0200
parents 2f928c913c78
children b10d12fbbb3f
comparison
equal deleted inserted replaced
112:c1a6ea47b838 113:7b0846025412
106 @param template: Template from which the values will be used 106 @param template: Template from which the values will be used
107 @return: The modified attributes""" 107 @return: The modified attributes"""
108 if self.object_db.has_key(template): 108 if self.object_db.has_key(template):
109 db_attributes = deepcopy(self.object_db[template]) 109 db_attributes = deepcopy(self.object_db[template])
110 for key in db_attributes.keys(): 110 for key in db_attributes.keys():
111 if attributes.has_key(key): 111 if attributes.has_key(key):
112 attributes[key] = attributes[key] or db_attributes[key] 112 tmp_attributes = db_attributes[key]
113 tmp_attributes.update(attributes[key])
114 attributes[key] = tmp_attributes
113 else: 115 else:
114 attributes[key] = db_attributes[key] 116 attributes[key] = db_attributes[key]
115 return attributes 117 return attributes
116 118
117 def isIDUsed(self, ID): 119 def isIDUsed(self, ID):