summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-10-11 16:11:20 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-13 16:33:20 (GMT)
commit2f46dca7c1d0016957dfd88831f453f06e080fef (patch)
treecab1f08654c1da126e70b4cd9d9f3196ff26d289 /src/powder.c
parent107e77a1a13f3dbdbc9703247f52f41716cd8115 (diff)
downloadpowder-2f46dca7c1d0016957dfd88831f453f06e080fef.zip
powder-2f46dca7c1d0016957dfd88831f453f06e080fef.tar.gz
Some work on DEST, EMP, LIGH
Change indentation to tabs, respect temperature limit (if a hotter reaction is required, should raise temp limit instead of ignoring it). DEST: fix TYPE_SOLID check, and prevent it displacing DMND EMP: randomise DLAY delay instead of heating it (since DLAY does not melt and does not transfer heat) Fix nearest_part so that t=-1 does not include dead particles
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index be22ca6..88d26a0 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -98,6 +98,7 @@ void init_can_move()
can_move[t][rt] = 2;
}
}
+ can_move[PT_DEST][PT_DMND] = 0;
can_move[PT_BIZR][PT_FILT] = 2;
can_move[PT_BIZRG][PT_FILT] = 2;
for (t=0;t<PT_NUM;t++)
@@ -1276,7 +1277,7 @@ int nearest_part(int ci, int t, int max_d)
int cy = (int)parts[ci].y;
for (i=0; i<=parts_lastActiveIndex; i++)
{
- if ((parts[i].type==t||t==-1)&&!parts[i].life&&i!=ci)
+ if ((parts[i].type==t||(t==-1&&parts[i].type))&&!parts[i].life&&i!=ci)
{
ndistance = abs(cx-parts[i].x)+abs(cy-parts[i].y);// Faster but less accurate Older: sqrt(pow(cx-parts[i].x, 2)+pow(cy-parts[i].y, 2));
if (ndistance<distance)