From fe5b58388594313e1d8048a9a5964a11cc448a16 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 20 Mar 2022 13:42:42 +0530 Subject: [PATCH] added default item char ? --- tetra/items.py | 2 +- tetra/maps.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tetra/items.py b/tetra/items.py index 3566a19..e059c68 100644 --- a/tetra/items.py +++ b/tetra/items.py @@ -9,7 +9,7 @@ def __init__(self, itempath): jsonobj = json.loads(open(itempath, encoding="utf-8").read()) self.name = jsonobj["name"] self.desc = jsonobj["desc"] - self.char = jsonobj.get("char", None) + self.char = jsonobj.get("char", "?") self.media_path = jsonobj.get("media_path", None) self.need_input = jsonobj["need_input"] self.answerhash = jsonobj.get("answerhash", None) diff --git a/tetra/maps.py b/tetra/maps.py index 346cc79..1c2f4b8 100644 --- a/tetra/maps.py +++ b/tetra/maps.py @@ -63,11 +63,11 @@ def render(self, settings): def place_item(self, item_name, game): if not (item_name in self.items.values()): coord = list(self.items_ref.keys())[list(self.items_ref.values()).index(item_name)] - if(game.item(item_name).char != None): self.fmt[coord] = game.item(item_name).char + self.fmt[coord] = game.item(item_name).char self.items[tuple(coord)] = self.items_ref[tuple(coord)] def remove_item(self, item_name, game): - if(item_name in self.items.values): + if(item_name in self.items.values()): coord = list(self.items_ref.keys())[list(self.items_ref.values()).index(item_name)] self.fmt[coord] = self.fmt_ref[coord] self.items.pop(tuple(coord))