Ignore:
Timestamp:
07/31/10 08:10:20 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Removed item_id from CarryableItem?.
  • item_type of CarryableItem? now store store the actual type of the item instead of the python class
  • Changed functions that find items by item_id to find items by item_type instead.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/gamemodel.py

    r608 r609  
    134134        info.update(extra) 
    135135        ID = info.pop("id") if info.has_key("id") else info.pop("ID") 
    136         if not info.has_key("item_id"): 
    137             info['item_id'] = ID 
     136        if not info.has_key("item_type"): 
     137            info["item_type"] = info["type"] 
    138138        ID = self.createUniqueID(ID) 
    139139        new_item = CarryableItem(ID = ID, **info)  
     
    504504                item_data = agent["item"] 
    505505            inst_dict["item"] = item_data 
    506             inst_dict["item_id"] = agent["ItemType"] 
     506            inst_dict["item_type"] = agent["ItemType"] 
    507507 
    508508        self.createMapObject(self.active_map.agent_layer, inst_dict, inst) 
Note: See TracChangeset for help on using the changeset viewer.