From 6ff4b20d81fe6d957c7b8dd342fcfa1d3857071f Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Tue, 27 Oct 2020 02:20:56 -0700 Subject: [PATCH] Only save reported locations that actually exist in the multidata. --- MultiServer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MultiServer.py b/MultiServer.py index 6f87c88c..54ba0d2d 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -455,10 +455,12 @@ def get_remaining(ctx: Context, team: int, slot: int) -> typing.List[int]: def register_location_checks(ctx: Context, team: int, slot: int, locations): found_items = False new_locations = set(locations) - ctx.location_checks[team, slot] + known_locations = set() if new_locations: ctx.client_activity_timers[team, slot] = datetime.datetime.now(datetime.timezone.utc) for location in new_locations: if (location, slot) in ctx.locations: + known_locations.add(location) target_item, target_player = ctx.locations[(location, slot)] if target_player != slot or slot in ctx.remote_items: found = False @@ -483,7 +485,7 @@ def register_location_checks(ctx: Context, team: int, slot: int, locations): if client.team == team and client.wants_item_notification: asyncio.create_task( ctx.send_msgs(client, [['ItemFound', (target_item, location, slot)]])) - ctx.location_checks[team, slot] |= new_locations + ctx.location_checks[team, slot] |= known_locations send_new_items(ctx) if found_items: