From 654fc6bccb8d4d61bbb8a92b5c257fe34a51593c Mon Sep 17 00:00:00 2001 From: Le_dahut Date: Fri, 2 May 2014 19:08:54 +0200 Subject: [PATCH] =?UTF-8?q?-Correction=20d'un=20bogue=20dans=20la=20foncti?= =?UTF-8?q?on=20Resize=20qui=20provoquait=20des=20erreur=20de=20centrage?= =?UTF-8?q?=20dans=20certaines=20paillasses.=20-Suppression=20d'un=20gros?= =?UTF-8?q?=20bogue=20qui=20provoquait=20l'inversion=20des=20=C3=A9l=C3=A9?= =?UTF-8?q?ments=20activables=20et=20non=20activables.=20-Encore=20un=20bo?= =?UTF-8?q?gue=20supprim=C3=A9=20lors=20du=20redimensionnement=20de=20la?= =?UTF-8?q?=20fen=C3=AAtre=20et=20que=20les=20caddits=20disponible=20sont?= =?UTF-8?q?=20=C3=A0=200.=20-=20Dans=20la=20fonction=20"reallystop",=20l'o?= =?UTF-8?q?ubli=20d'un=20deepcopy=20provoquait=20des=20erreurs=20de=20r?= =?UTF-8?q?=C3=A9initialisation=20de=20la=20variable=20current=20depuis=20?= =?UTF-8?q?le=20dictionaire=20persistant=20qui=20=C3=A9tait=20lui=20aussi?= =?UTF-8?q?=20modifi=C3=A9.=20-La=20fonction=20invert,=20bogu=C3=A9e,=20mo?= =?UTF-8?q?difiait=20la=20charge=20neutre=20d'un=20=C3=A9lectron=20neutre.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WireChem.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/WireChem.py b/WireChem.py index 3183785..8e20006 100644 --- a/WireChem.py +++ b/WireChem.py @@ -124,7 +124,7 @@ def initgrid(): allcout=[0,0,0] sizex=sizey=1 seestat=thecout=world=over=play=cycle=rayon=temp=cout=decx=decy=unroll=nrj=0 - debug=1 + debug=0 tech=selected=level=-1 statedvar=[stat[0],stat[1],stat[2],stat[3],stat[4],stat[5],stat[6],stat[7],stat[8],nrj,temp,rayon,current[7],current[8],current[9],current[10],current[11],current[12]] if len(stat_var)==0: @@ -147,10 +147,10 @@ def resize(): allsizex=2*win.width/3 else: allsizex=win.width - if sizex/float(sizey)0: - txt_cout.x=posx+addx+44 txt_cout.color=(180, 180, 180,255) else: txt_cout.color=(255, 0, 0,255) @@ -1024,7 +1024,7 @@ def reallystop(): dat['run']['value']='stop' play=0 clock.unschedule(calculate) - current=worlds[world][level]['current'] + current=copy.deepcopy(worlds[world][level]['current']) cycle=worlds[world][level]['cycle'] temp=worlds[world][level]['temp'] nrj=worlds[world][level]['nrj'] @@ -1204,8 +1204,10 @@ def negative(x): def invert(x): if ispositive(x): return negative(x) - else: + elif isnegative(x): return positive(x) + else: + return x def isbig(x): return (x & int("0xF000",16))==int("0x2000",16)