Changeset 608


Ignore:
Timestamp:
07/31/10 07:34:26 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • The real item stored in MapItem? is now the instance of the item instead of a dictionary to create the item. This allows to access variables and methods of the item.
Location:
trunk/game/scripts
Files:
2 edited

Legend:

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

    r596 r608  
    500500                item_data["type"] = agent["ItemType"] 
    501501                item_data["ID"] = inst_id  
     502                item_data = self.createContainerObject(item_data) 
    502503            else: 
    503504                item_data = agent["item"] 
  • trunk/game/scripts/objects/action.py

    r605 r608  
    338338         
    339339    def execute(self): 
    340         real_item = self.model.createContainerObject(self.map_item.item) 
     340        real_item = self.map_item.item 
    341341        self.model.deleteObject(self.map_item.ID) 
    342342        self.model.game_state.player_character.\ 
     
    352352         
    353353    def execute(self): 
    354         item_data = self.item.getStateForSaving() 
    355         item_data["type"] = self.item.item_type 
    356354        map_name = self.model.game_state.current_map_name 
    357355        map_item_values = {} 
     
    364362        map_item_values["Position"] = (coords.x, coords.y) 
    365363        map_item_values["Rotation"] = 0 
    366         map_item_values["item"] = item_data 
     364        map_item_values["item"] = self.item 
    367365        agent = {} 
    368366        agent[self.item.ID] = map_item_values 
     
    380378    def execute(self): 
    381379        super(DropItemFromContainerAction, self).execute() 
     380        self.item.in_container.takeItem(self.item) 
    382381        self.container_gui.updateImages() 
    383382 
Note: See TracChangeset for help on using the changeset viewer.