Skip to content

Commit

Permalink
added default item char ?
Browse files Browse the repository at this point in the history
  • Loading branch information
20akshay00 committed Mar 20, 2022
1 parent 2a463e3 commit fe5b583
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tetra/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tetra/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit fe5b583

Please sign in to comment.