diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-08 15:19:23 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-08 15:19:23 (GMT) |
| commit | 61bbc36cfaca3640b86dfe0bc21e02eab5a32d80 (patch) | |
| tree | 1c819e8e49c2bbac9489103d3488fa29579e6648 | |
| parent | 950f5c34a32bf2c441fe950b79c9b209f37381c1 (diff) | |
| download | powder-61bbc36cfaca3640b86dfe0bc21e02eab5a32d80.zip powder-61bbc36cfaca3640b86dfe0bc21e02eab5a32d80.tar.gz | |
Fix Gol with Wire placed
| -rw-r--r-- | includes/powder.h | 2 | ||||
| -rw-r--r-- | src/powder.c | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/includes/powder.h b/includes/powder.h index 23f4217..71ac93d 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -936,7 +936,7 @@ particle portalp[CHANNELS][8][80]; const particle emptyparticle; int wireless[CHANNELS][2]; -extern int ISWIRE; +extern int wire_placed; extern int gravwl_timeout; diff --git a/src/powder.c b/src/powder.c index 4add0b6..f95c8e7 100644 --- a/src/powder.c +++ b/src/powder.c @@ -7,7 +7,7 @@ int gravwl_timeout = 0; -int ISWIRE = 0; +int wire_placed = 0; float player[28]; //[0] is a command cell, [3]-[18] are legs positions, [19]-[26] are accelerations, [27] shows if player was spawned float player2[28]; @@ -1469,17 +1469,20 @@ void update_particles_i(pixel *vid, int start, int inc) } } //wire! - if(ISWIRE == 1) + if(wire_placed == 1) { - ISWIRE = 0; + wire_placed = 0; for (nx=0; nx<XRES; nx++) + { for (ny=0; ny<YRES; ny++) { r = pmap[ny][nx]; if ((r>>8)>=NPART || !r) continue; - parts[r>>8].tmp=parts[r>>8].ctype; + if(parts[r>>8].type==PT_WIRE) + parts[r>>8].tmp=parts[r>>8].ctype; } + } } //game of life! if (ISGOL==1&&++CGOL>=GSPEED)//GSPEED is frames per generation @@ -1890,7 +1893,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if (t==PT_WIRE) { - ISWIRE = 1; + wire_placed = 1; } //spark updates from walls if ((ptypes[t].properties&PROP_CONDUCTS) || t==PT_SPRK) |
