Skip to content

Commit

Permalink
add some sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Jun 19, 2024
1 parent 0d43a7e commit 86d993b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NetUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,16 @@ class Hint(typing.NamedTuple):
status: HintStatus = HintStatus.HINT_UNSPECIFIED

def re_check(self, ctx, team) -> Hint:
if self.found:
if self.found and self.status == HintStatus.HINT_FOUND:
return self
found = self.location in ctx.location_checks[team, self.finding_player]
if found:
return self._replace(found=found, status=HintStatus.HINT_FOUND)
return self

def re_prioritize(self, ctx, status: HintStatus) -> Hint:
if self.found and status != HintStatus.HINT_FOUND:
status = HintStatus.HINT_FOUND
if status != self.status:
return self._replace(status=status)
return self
Expand Down
2 changes: 2 additions & 0 deletions kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ def refresh_hints(self, hints):
self.scroll_y = 1.0
data = []
for hint in hints:
if not hint.get("status"): # Allows connecting to old servers
hint["status"] = HintStatus.HINT_FOUND if hint["found"] else HintStatus.HINT_UNSPECIFIED
data.append({
"receiving": {"text": self.parser.handle_node({"type": "player_id", "text": hint["receiving_player"]})},
"item": {"text": self.parser.handle_node({
Expand Down

0 comments on commit 86d993b

Please sign in to comment.