From 685bc607ffc97579ab5522e9c799ee0eef334777 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 5 Mar 2016 21:20:17 +0200 Subject: [PATCH] Gain items. --- koperkapel/gamelib/items.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koperkapel/gamelib/items.py b/koperkapel/gamelib/items.py index 9ef2ff6..af66dd9 100644 --- a/koperkapel/gamelib/items.py +++ b/koperkapel/gamelib/items.py @@ -14,7 +14,7 @@ def build_weapon(item): return actor -ITEM_TYPES = { +ITEM_BUILDERS = { "serum": build_serum, "weapon": build_weapon, } @@ -23,7 +23,9 @@ ITEM_TYPES = { def get_item(item): item_type = item.pop("type") game_pos = tuple(item.pop("pos")) - actor = ITEM_TYPES[item_type](item) + actor = ITEM_BUILDERS[item_type](item) + actor.item_type = item_type + actor.item_data = item actor.game_pos = game_pos actor.anchor = (0, 0) return actor -- 2.34.1