summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-04-26 15:46:57 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-04-26 15:46:57 (GMT)
commit06c0949beb5db99b718c8a8b9dbefaf6c1655006 (patch)
tree990f14aedfd26d1145574520f204221b1404db0a /src
parent75d5cc3d049a42c63254b4a4810447955398cf22 (diff)
downloadpowder-06c0949beb5db99b718c8a8b9dbefaf6c1655006.zip
powder-06c0949beb5db99b718c8a8b9dbefaf6c1655006.tar.gz
Gravity breaks elements like pressure does (Doesn't work for broken metal and needs tweaking a little)
Diffstat (limited to 'src')
-rw-r--r--src/powder.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/powder.c b/src/powder.c
index 8409d1b..6335130 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1668,8 +1668,12 @@ void update_particles_i(pixel *vid, int start, int inc)
if (ptransitions[t].plt!=PT_NUM)
t = ptransitions[t].plt;
else s = 0;
- }
- else s = 0;
+ } else if ((fabsf(gravy[y/CELL][x/CELL])+fabsf(gravx[y/CELL][x/CELL]))>(ptransitions[t].phv/4.0f)&&ptransitions[t].pht>-1) {
+ // particle type change due to high gravity
+ if (ptransitions[t].pht!=PT_NUM)
+ t = ptransitions[t].pht;
+ else s = 0;
+ } else s = 0;
if (s) { // particle type change occurred
parts[i].life = 0;
part_change_type(i,x,y,t);