summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorBryan Hoyle <starfoxprime@gmail.com>2011-08-25 22:45:35 (GMT)
committer Bryan Hoyle <starfoxprime@gmail.com>2011-08-25 22:45:35 (GMT)
commit10f0c6665f81de9634703397b829d2c675910800 (patch)
tree1eff1325957ab12a96012112e3e1f189226e7d7e /src/elements
parent1c291ac31db9eb70b0a0e93b6a2208c638949f56 (diff)
parentcaf0ee76e3c281f82865b773ce8950de22db3cfa (diff)
downloadpowder-10f0c6665f81de9634703397b829d2c675910800.zip
powder-10f0c6665f81de9634703397b829d2c675910800.tar.gz
Merge remote branch 'origin/master'
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/co2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/elements/co2.c b/src/elements/co2.c
new file mode 100644
index 0000000..9c5463a
--- /dev/null
+++ b/src/elements/co2.c
@@ -0,0 +1,19 @@
+#include <element.h>
+
+int update_CO2(UPDATE_FUNC_ARGS) {
+ int r, rx, ry;
+ for (rx=-2; rx<3; rx++)
+ for (ry=-2; ry<3; ry++)
+ if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ {
+ r = pmap[y+ry][x+rx];
+ if ((r>>8)>=NPART || !r)
+ continue;
+ /*if ((r&0xFF)==PT_CNCT && 1>(rand()%500)) Concrete+Water to paste, not very popular
+ {
+ part_change_type(i,x,y,PT_PSTE);
+ kill_part(r>>8);
+ }*/
+ }
+ return 0;
+}