MultiServer: Fix hinting an item that someone else already hinted in their slot not resolving correctly (#4655)

* Fix get_hint not checking for finding_player

* Fix using the wrong variable for slot lookup
This commit is contained in:
NewSoupVi
2025-02-17 15:16:18 +01:00
committed by GitHub
parent 378fa5d5c4
commit d744e086ef

View File

@@ -783,7 +783,7 @@ class Context:
def get_hint(self, team: int, finding_player: int, seeked_location: int) -> typing.Optional[Hint]:
for hint in self.hints[team, finding_player]:
if hint.location == seeked_location:
if hint.location == seeked_location and hint.finding_player == finding_player:
return hint
return None
@@ -1135,7 +1135,7 @@ def collect_hints(ctx: Context, team: int, slot: int, item: typing.Union[int, st
seeked_item_id = item if isinstance(item, int) else ctx.item_names_for_game(ctx.games[slot])[item]
for finding_player, location_id, item_id, receiving_player, item_flags \
in ctx.locations.find_item(slots, seeked_item_id):
prev_hint = ctx.get_hint(team, slot, location_id)
prev_hint = ctx.get_hint(team, finding_player, location_id)
if prev_hint:
hints.append(prev_hint)
else: