Skip to content

Commit

Permalink
Fix hints causing an exception for missing player info.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhar committed May 29, 2024
1 parent 7065b76 commit e43e613
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,18 @@ def refresh_hints(self, hints):
for hint in hints:
data.append({
"receiving": {"text": self.parser.handle_node({"type": "player_id", "text": hint["receiving_player"]})},
"item": {"text": self.parser.handle_node(
{"type": "item_id", "text": hint["item"], "flags": hint["item_flags"]})},
"item": {"text": self.parser.handle_node({
"type": "item_id",
"text": hint["item"],
"flags": hint["item_flags"],
"player": hint["receiving_player"],
})},
"finding": {"text": self.parser.handle_node({"type": "player_id", "text": hint["finding_player"]})},
"location": {"text": self.parser.handle_node({"type": "location_id", "text": hint["location"]})},
"location": {"text": self.parser.handle_node({
"type": "location_id",
"text": hint["location"],
"player": hint["finding_player"],
})},
"entrance": {"text": self.parser.handle_node({"type": "color" if hint["entrance"] else "text",
"color": "blue", "text": hint["entrance"]
if hint["entrance"] else "Vanilla"})},
Expand Down

0 comments on commit e43e613

Please sign in to comment.