summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-05-14 12:34:06 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-14 12:34:06 (GMT)
commit73f2f9f57fd6efa4ed386a86f5a8d118d879a629 (patch)
treee38f378c20c7107f178efae736465aebd27dae83 /src/powder.c
parentc23124e0d7f072e40701e1250618b295fb2117dc (diff)
downloadpowder-73f2f9f57fd6efa4ed386a86f5a8d118d879a629.zip
powder-73f2f9f57fd6efa4ed386a86f5a8d118d879a629.tar.gz
fix neutron cloning
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index 2264f09..6aa43ce 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -168,6 +168,10 @@ int try_move(int i, int x, int y, int nx, int ny)
if ((r & 0xFF) < PT_NUM && ptypes[r&0xFF].hconduct)
parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
}
+ if (parts[i].type==PT_NEUT && ((r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_BCLN)) {
+ if (!parts[r>>8].ctype)
+ parts[r>>8].ctype = PT_NEUT;
+ }
return 0;
}
@@ -250,7 +254,8 @@ int try_move(int i, int x, int y, int nx, int ny)
return 0;
}
- if ((r&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles
+
+ if ((pmap[ny][nx]&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles
return 0;
if (parts[i].type==PT_CNCT && y<ny && (pmap[y+1][x]&0xFF)==PT_CNCT)//check below CNCT for another CNCT
return 0;