Gravity breaks elements like pressure does (Doesn't work for broken metal and needs tweaking a little)

This commit is contained in:
Simon Robertshaw 2011-04-26 16:46:57 +01:00
parent 75d5cc3d04
commit 06c0949beb

View File

@ -1668,8 +1668,12 @@ void update_particles_i(pixel *vid, int start, int inc)
if (ptransitions[t].plt!=PT_NUM) if (ptransitions[t].plt!=PT_NUM)
t = ptransitions[t].plt; 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) {
else s = 0; // 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 if (s) { // particle type change occurred
parts[i].life = 0; parts[i].life = 0;
part_change_type(i,x,y,t); part_change_type(i,x,y,t);