Skip to content

Commit 52d55a3

Browse files
authored
Fix check for empty sockets (#34)
1 parent c155c2d commit 52d55a3

2 files changed

Lines changed: 2977 additions & 5914 deletions

File tree

slao_bot/cogs/gear.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ def _check_sockets(self, raider_name: str, item: Dict) -> None:
4444
:param raider_name: Raider name
4545
:param item: Equipped item dictionary
4646
"""
47-
# Let's check for gems quality every time. Until we will be able to check sockets count
48-
if 'gems' not in item:
49-
return
50-
51-
for gem in item['gems']:
52-
if gem['itemLevel'] < MIN_GEM_ILEVEL:
53-
self.low_quality_gems[raider_name].add(SLOT_NAMES.get(item['slot']))
5447

5548
sockets_num = SOCKETS.get(item['id'])
5649
if sockets_num is None:
@@ -60,6 +53,10 @@ def _check_sockets(self, raider_name: str, item: Dict) -> None:
6053
# No gems in sockets
6154
self.empty_sockets[raider_name].add(SLOT_NAMES.get(item['slot']))
6255
# All sockets are gemmed. Let's check gems level
56+
else:
57+
for gem in item['gems']:
58+
if gem['itemLevel'] < MIN_GEM_ILEVEL:
59+
self.low_quality_gems[raider_name].add(SLOT_NAMES.get(item['slot']))
6360

6461
def _check_enchants(self, raider_name: str, item: Dict) -> None:
6562
"""Checks item for missing or low quality enchant
@@ -117,8 +114,7 @@ async def process_interaction(self, report_id: str) -> Optional[discord.Embed]:
117114

118115
embed.add_field(
119116
name='Нет камней',
120-
# value=self._print_raiders(equipment.empty_sockets) or 'Камни вставлены у всех!',
121-
value='Блесс, где список сокетов?',
117+
value=self._print_raiders(equipment.empty_sockets) or 'Камни вставлены у всех!',
122118
inline=False,
123119
)
124120
embed.add_field(

0 commit comments

Comments
 (0)