Skip to content

Commit d8e7ced

Browse files
committed
fix: don't set faction weapon when faction has none
1 parent 7719430 commit d8e7ced

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

data_source/game_data.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,14 @@ def enrich_kingdoms(self):
391391
kingdom['underworld'] and kingdom['troop_ids']]
392392
for faction_id, faction_data in factions:
393393
kingdom_id = faction_data['linked_kingdom_id']
394-
faction_weapon = [w['id'] for w in self.weapons.values()
395-
if w['kingdom']['id'] == kingdom_id
396-
and w['requirement'] == 1000
397-
and sorted(w['colors']) == sorted(faction_data['colors'])
398-
and w['rarity'] == 'Epic'
399-
][-1]
400-
self.kingdoms[faction_id]['event_weapon'] = self.weapons[faction_weapon]
394+
faction_weapons = [w['id'] for w in self.weapons.values()
395+
if w['kingdom']['id'] == kingdom_id
396+
and w['requirement'] == 1000
397+
and sorted(w['colors']) == sorted(faction_data['colors'])
398+
and w['rarity'] == 'Epic'
399+
]
400+
if faction_weapons:
401+
self.kingdoms[faction_id]['event_weapon'] = self.weapons[faction_weapons[-1]]
401402

402403
def populate_soulforge(self):
403404
tabs = [

0 commit comments

Comments
 (0)