Tracker: fix ItemLinks items not being attributed to inventory
This commit is contained in:
parent
0045e3f9f7
commit
e13e7f286c
|
@ -25,9 +25,9 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{% for name, count in inventory.items() %}
|
{% for id, count in inventory.items() %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ name | item_name }}</td>
|
<td>{{ id | item_name }}</td>
|
||||||
<td>{{ count }}</td>
|
<td>{{ count }}</td>
|
||||||
<td>{{received_items[name]}}</td>
|
<td>{{received_items[name]}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -316,6 +316,11 @@ def getPlayerTracker(tracker: UUID, tracked_team: int, tracked_player: int, want
|
||||||
else:
|
else:
|
||||||
multisave: Dict[str, Any] = {}
|
multisave: Dict[str, Any] = {}
|
||||||
|
|
||||||
|
slots_aimed_at_player = {tracked_player}
|
||||||
|
for group_id, group_members in groups.items():
|
||||||
|
if tracked_player in group_members:
|
||||||
|
slots_aimed_at_player.add(group_id)
|
||||||
|
|
||||||
# Add items to player inventory
|
# Add items to player inventory
|
||||||
for (ms_team, ms_player), locations_checked in multisave.get("location_checks", {}).items():
|
for (ms_team, ms_player), locations_checked in multisave.get("location_checks", {}).items():
|
||||||
# Skip teams and players not matching the request
|
# Skip teams and players not matching the request
|
||||||
|
@ -325,7 +330,7 @@ def getPlayerTracker(tracker: UUID, tracked_team: int, tracked_player: int, want
|
||||||
for location in locations_checked:
|
for location in locations_checked:
|
||||||
if location in player_locations:
|
if location in player_locations:
|
||||||
item, recipient, flags = player_locations[location]
|
item, recipient, flags = player_locations[location]
|
||||||
if recipient == tracked_player: # a check done for the tracked player
|
if recipient in slots_aimed_at_player: # a check done for the tracked player
|
||||||
attribute_item_solo(inventory, item)
|
attribute_item_solo(inventory, item)
|
||||||
if ms_player == tracked_player: # a check done by the tracked player
|
if ms_player == tracked_player: # a check done by the tracked player
|
||||||
checks_done[location_to_area[location]] += 1
|
checks_done[location_to_area[location]] += 1
|
||||||
|
@ -884,7 +889,6 @@ def __renderSuperMetroidTracker(multisave: Dict[str, Any], room: Room, locations
|
||||||
|
|
||||||
for item_name, item_id in multi_items.items():
|
for item_name, item_id in multi_items.items():
|
||||||
base_name = item_name.split()[0].lower()
|
base_name = item_name.split()[0].lower()
|
||||||
count = inventory[item_id]
|
|
||||||
display_data[base_name+"_count"] = inventory[item_id]
|
display_data[base_name+"_count"] = inventory[item_id]
|
||||||
|
|
||||||
# Victory condition
|
# Victory condition
|
||||||
|
|
Loading…
Reference in New Issue