Ignore:
Timestamp:
07/21/10 17:11:48 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Added basic support for adding items on the map. Currently no interaction with the items are possible.
  • Added a bottle to the "Mall" map, its lying between the wooden crate and the "To farm" "door".
File:
1 edited

Legend:

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

    r590 r592  
    317317        if agent_values.has_key("ObjectModel"):  
    318318            object_model =  agent_values["ObjectModel"] 
     319        elif agent_values["ObjectType"] == "MapItem": 
     320            object_model = self.object_db[agent_values["ItemType"]]["gfx"]             
    319321        else: 
    320322            object_model = self.object_db[agent_values["ObjectType"]]["gfx"] 
     
    384386                                else None 
    385387        if object_id == None: 
    386             object_id = self.object_db[object_type]["gfx"] 
     388            if object_type == "MapItem": 
     389                object_id = self.object_db[agent["ItemType"]]["gfx"] 
     390            else: 
     391                object_id = self.object_db[object_type]["gfx"] 
    387392        map_obj = self.fife_model.getObject(str(object_id), "PARPG") 
    388393        if not map_obj: 
     
    464469                items.append(self.createContainerObject(inventory_obj)) 
    465470            inst_dict["items"] = items 
    466  
    467                      
     471             
     472        if agent.has_key("ItemType"): 
     473            inst_dict["item"] = None #TODO: Create item 
     474            inst_dict["item_id"] = agent["ItemType"] 
     475         
    468476        self.createMapObject(self.active_map.agent_layer, inst_dict, inst) 
    469477     
Note: See TracChangeset for help on using the changeset viewer.