Changeset 150

Show
Ignore:
Timestamp:
04/26/08 21:39:33 (7 months ago)
Author:
thib
Message:

...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • adventure/thing.py

    r148 r150  
    7373        action_obj = dict() 
    7474        action_obj['name'] = action_element.localName 
    75         for i in ('target', 'count'): 
    76             action_obj[i] = action_element.getAttribute(i) 
     75         
     76        action_obj['target'] = action_element.getAttribute('target') 
     77        if action_element.has_key('count'): 
     78            action_obj['count'] = int(action_element.getAttribute('count')) 
    7779         
    7880        if action_element.firstChild and action_element.firstChild.data: 
     
    166168                target = player 
    167169            if target: 
    168                 if not action['count'] or target.inventory.count(params) < action['count']: 
     170                if not action.has_key('count') or target.inventory.count(params) < action['count']: 
    169171                    target.inventory.append(params) 
    170172        #   <use target="target">object</give>