summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-07 18:17:50 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-07 18:17:50 (GMT)
commit04a09d997d3afc9d99255b469aa24ede2b25e881 (patch)
treeb7a4e48adf9e6c7f347f151b489190cf67e63dd3 /src
parent2fb1da2fedf1f85463fa18fe6032804f0a85410f (diff)
downloadpowder-04a09d997d3afc9d99255b469aa24ede2b25e881.zip
powder-04a09d997d3afc9d99255b469aa24ede2b25e881.tar.gz
Titanium only blocks air when it is connected
Diffstat (limited to 'src')
-rw-r--r--src/elements/ttan.c25
-rw-r--r--src/powder.c6
2 files changed, 26 insertions, 5 deletions
diff --git a/src/elements/ttan.c b/src/elements/ttan.c
index 82d2897..d0ff4ce 100644
--- a/src/elements/ttan.c
+++ b/src/elements/ttan.c
@@ -16,7 +16,28 @@
#include <element.h>
int update_TTAN(UPDATE_FUNC_ARGS) {
- bmap_blockair[y/CELL][x/CELL] = 1;
- bmap_blockairh[y/CELL][x/CELL] = 1;
+ int nx, ny, ttan = 0;
+ if(nt<8)
+ {
+ for (nx=-1; nx<2; nx++)
+ for (ny=-1; ny<2; ny++) {
+ if (!nx != !ny) {
+ if((pmap[y+ny][x+nx]&0xFF)==PT_TTAN)
+ {
+ ttan++;
+ }
+ }
+ }
+ if(ttan>=2)
+ {
+ bmap_blockair[y/CELL][x/CELL] = 1;
+ bmap_blockairh[y/CELL][x/CELL] = 1;
+ }
+ }
+ if(parts[i].tmp)
+ {
+ bmap_blockair[y/CELL][x/CELL] = 1;
+ bmap_blockairh[y/CELL][x/CELL] = 1;
+ }
return 0;
}
diff --git a/src/powder.c b/src/powder.c
index 82d52b7..dc8bb3b 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1905,16 +1905,16 @@ void update_particles_i(pixel *vid, int start, int inc)
#endif
}
- j = surround_space = nt = 0;//if nt is 1 after this, then there is a particle around the current particle, that is NOT the current particle's type, for water movement.
+ j = surround_space = nt = 0;//if nt is greater than 1 after this, then there is a particle around the current particle, that is NOT the current particle's type, for water movement.
for (nx=-1; nx<2; nx++)
for (ny=-1; ny<2; ny++) {
if (nx||ny) {
surround[j] = r = pmap[y+ny][x+nx];
j++;
if (!(r&0xFF))
- surround_space = 1;//there is empty space
+ surround_space++;//there is empty space
if ((r&0xFF)!=t)
- nt = 1;//there is nothing or a different particle
+ nt++;//there is nothing or a different particle
}
}