From 06c0949beb5db99b718c8a8b9dbefaf6c1655006 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 26 Apr 2011 16:46:57 +0100 Subject: [PATCH] Gravity breaks elements like pressure does (Doesn't work for broken metal and needs tweaking a little) --- src/powder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/powder.c b/src/powder.c index 8409d1b91..63351305b 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);