Only save reported locations that actually exist in the multidata.
This commit is contained in:
		
							parent
							
								
									7cf4ad35a9
								
							
						
					
					
						commit
						6ff4b20d81
					
				| 
						 | 
					@ -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):
 | 
					def register_location_checks(ctx: Context, team: int, slot: int, locations):
 | 
				
			||||||
    found_items = False
 | 
					    found_items = False
 | 
				
			||||||
    new_locations = set(locations) - ctx.location_checks[team, slot]
 | 
					    new_locations = set(locations) - ctx.location_checks[team, slot]
 | 
				
			||||||
 | 
					    known_locations = set()
 | 
				
			||||||
    if new_locations:
 | 
					    if new_locations:
 | 
				
			||||||
        ctx.client_activity_timers[team, slot] = datetime.datetime.now(datetime.timezone.utc)
 | 
					        ctx.client_activity_timers[team, slot] = datetime.datetime.now(datetime.timezone.utc)
 | 
				
			||||||
        for location in new_locations:
 | 
					        for location in new_locations:
 | 
				
			||||||
            if (location, slot) in ctx.locations:
 | 
					            if (location, slot) in ctx.locations:
 | 
				
			||||||
 | 
					                known_locations.add(location)
 | 
				
			||||||
                target_item, target_player = ctx.locations[(location, slot)]
 | 
					                target_item, target_player = ctx.locations[(location, slot)]
 | 
				
			||||||
                if target_player != slot or slot in ctx.remote_items:
 | 
					                if target_player != slot or slot in ctx.remote_items:
 | 
				
			||||||
                    found = False
 | 
					                    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:
 | 
					                                if client.team == team and client.wants_item_notification:
 | 
				
			||||||
                                    asyncio.create_task(
 | 
					                                    asyncio.create_task(
 | 
				
			||||||
                                        ctx.send_msgs(client, [['ItemFound', (target_item, location, slot)]]))
 | 
					                                        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)
 | 
					        send_new_items(ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if found_items:
 | 
					        if found_items:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue