Correction de la fonction reference qui permet de rajouter des informations dans le dictionnaire en fonction de leur positionnement dans une liste.

This commit is contained in:
Le_dahut 2014-03-08 22:08:40 +01:00
parent 8021754366
commit 910fd6d5bb
1 changed files with 9 additions and 7 deletions

View File

@ -54,12 +54,14 @@ def load(d):
globals()[k]=copy.deepcopy(d[k]) globals()[k]=copy.deepcopy(d[k])
def reference(var,noms): def reference(var,noms):
sizex=len(var) if len(noms)==2:
if len(noms)==2: sizey=len(var[0]) for y in range(len(var)):
for x in range(sizex): for x in range(len(var[y])):
for y in range(sizey): var[y][x][noms[0]]=y
var[x][y][noms[0]]=x var[y][x][noms[1]]=x
if len(noms)==2: var[x][y][noms[1]]=y else:
for x in range(len(var[y])):
var[x][y][noms[0]]=x
'''Ancienne fonctions''' '''Ancienne fonctions'''
@ -203,7 +205,7 @@ def savelevel(w,l):
Uworlds.append(0) Uworlds.append(0)
Uworlds[w]=[] Uworlds[w]=[]
while len(Uworlds[w])<=l: while len(Uworlds[w])<=l:
Uworlds[w].append({'level':level,'world':world}) Uworlds[w].append({})
Uworlds[w][l]={'nom':nom, Uworlds[w][l]={'nom':nom,
'element':element, 'element':element,
'description':descriptif, 'description':descriptif,