summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2011-01-14 15:50:07 (GMT)
committer Cracker64 <cracker642@gmail.com>2011-01-14 16:05:08 (GMT)
commite33fb40e2d670af84c8b27c69cc170c2213bcd33 (patch)
tree97d475010e246eedbbb9a9e17c5bd02263b545d2 /src
parentb673be0ac2db3bc3806f8b21eef66c606aabf4b2 (diff)
downloadpowder-e33fb40e2d670af84c8b27c69cc170c2213bcd33.zip
powder-e33fb40e2d670af84c8b27c69cc170c2213bcd33.tar.gz
oops, didn't need the floodfill thing there.
Diffstat (limited to 'src')
-rw-r--r--src/powder.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/powder.c b/src/powder.c
index 324a34f..e8e3873 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -24,6 +24,7 @@ int pfree;
unsigned pmap[YRES][XRES];
unsigned cb_pmap[YRES][XRES];
+unsigned photons[YRES][XRES];
static int pn_junction_sprk(int x, int y, int pt)
{
@@ -580,7 +581,9 @@ inline int create_part(int p, int x, int y, int t)
}
}
}
- if(pfree == -1)
+ if(photons[y][x] && t==PT_PHOT)
+ return -1;
+ if(pfree == -1)
return -1;
i = pfree;
pfree = parts[i].life;
@@ -5950,7 +5953,7 @@ int flood_parts(int x, int y, int c, int cm, int bm)
x1 = x2 = x;
while(x1>=CELL)
{
- if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm || (photons[y][x1-1]&0xFF)!=cm)
+ if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm)
{
break;
}
@@ -5958,7 +5961,7 @@ int flood_parts(int x, int y, int c, int cm, int bm)
}
while(x2<XRES-CELL)
{
- if((pmap[y][x2+1]&0xFF)!=cm || bmap[y/CELL][(x2+1)/CELL]!=bm || (photons[y][x1+1]&0xFF)!=cm)
+ if((pmap[y][x2+1]&0xFF)!=cm || bmap[y/CELL][(x2+1)/CELL]!=bm)
{
break;
}