inputting codes with medals no longer crashes, medals now actually save! But medals on the same build from different codes probably don't save correctly yet.
This commit is contained in:
parent
8f3bc473b0
commit
300c4e8315
|
@ -90,7 +90,7 @@ def read_code(code,save=True):
|
|||
print(str(rank)+'/'+str(cap))
|
||||
print(data) # Extract medals and save them
|
||||
medals=data[1:-1]
|
||||
if any(medals): conf[active_profile]['medals'][shared.muxhero(hero[0],hero[3],hero[4])]=shared.muxmedals(medals)
|
||||
if any(medals): conf[active_profile]['medals'][shared.muxhero(hero[0],hero[3],hero[4])]=shared.muxmedals(*medals)
|
||||
if not check: print('No name given, code validation not performed')
|
||||
else:
|
||||
if check!=validator: print('code did not validate:',validator,check); return
|
||||
|
|
|
@ -32,5 +32,6 @@ def muxhero(clas,trait,spec):
|
|||
return clas+trait*12+spec*12*16 # It's actually stored backwards like this, spec is in the most significant bits. Whatever, it doesn't need to be reversable.
|
||||
|
||||
def muxmedals(key,moh=-1,pcc=-1,cob=-1,lsa=-1,rem=-1):
|
||||
print(key,moh,pcc,cob,lsa,rem)
|
||||
if moh!=-1: return key+moh*2+pcc*4+cob*8+lsa*16+rem*32
|
||||
return bool(key&1),bool(key&2),bool(key&4),bool(key&8),bool(key&16),key//32
|
Loading…
Reference in New Issue
Block a user