diff --git a/truthinquiry/logic/game_logic.py b/truthinquiry/logic/game_logic.py index f5a7bcf..d4731dc 100644 --- a/truthinquiry/logic/game_logic.py +++ b/truthinquiry/logic/game_logic.py @@ -134,7 +134,7 @@ class Game: """ print(self.reaction_table) if npc_id not in self.reaction_table: - return 0 + return None trait_id = self.reaction_table[npc_id] reaction = db.session.execute( diff --git a/truthinquiry/routes/routes_api.py b/truthinquiry/routes/routes_api.py index 4f797d0..879a764 100644 --- a/truthinquiry/routes/routes_api.py +++ b/truthinquiry/routes/routes_api.py @@ -147,9 +147,8 @@ def get_npc_reaction(): npc_id = flask.request.values.get("npcid") image = game.get_npc_reaction(npc_id) - errors = ["npc not in game","error reading file"] - if image in [0,1]: - return {"error": 1, "msg": errors[image]} + if image == None: + return {"error": 1, "msg": "npc not in game"} response = flask.make_response(image) response.headers.set('Content-Type', 'image/png')