diff --git a/codegen.py b/codegen.py index 3ea7b6e..15c8437 100644 --- a/codegen.py +++ b/codegen.py @@ -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 diff --git a/shared.py b/shared.py index 70b7db4..21fb9ad 100644 --- a/shared.py +++ b/shared.py @@ -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 \ No newline at end of file