Check for maximum number of skills

main
Bob Mottram 2021-06-07 10:18:19 +01:00
parent fc3a5c664c
commit 35b91d6907
1 changed files with 5 additions and 0 deletions

View File

@ -95,6 +95,11 @@ def setActorSkillLevel(actorJson: {},
]
ocSkillsList = getOccupationSkills(actorJson)
skillsDict = getSkillsFromList(ocSkillsList)
if not skillsDict.get(skill):
if len(skillsDict.items()) >= 100:
print('WARN: Maximum number of skills reached for ' +
actorJson['id'])
return False
if skillLevelPercent > 0:
skillsDict[skill] = skillLevelPercent
else: