Work around EVE bug (Assault Frigs have raceID assigned) and make race detection to cope with 3+ skill reqs better overall, which fixes race detection for revenant and alike

This commit is contained in:
DarkPhoenix
2014-11-06 02:42:05 +03:00
parent 89052edda2
commit 7077261fe1

View File

@@ -255,10 +255,11 @@ class Item(EqBase):
race = None
# Check primary and secondary required skills' races
if race is None:
skills = self.requiredSkills.keys()
skillPrimaryRace = (skills[0].raceID if len(skills) >= 1 else 0) or 0
skillSecondaryRace = (skills[1].raceID if len(skills) >= 2 else 0) or 0
skillRaces = (skillPrimaryRace, skillSecondaryRace)
# Currently Assault Frigates skill has raceID set, which is actually
# EVE's bug
ignoredSkills = ('Assault Frigates',)
skills = tuple(filter(lambda i: i.name not in ignoredSkills, self.requiredSkills.keys()))
skillRaces = tuple(filter(lambda rid: rid, (s.raceID for s in skills)))
if sum(skillRaces) in map:
race = map[sum(skillRaces)]
if race == "angelserp":