Fix O2 and H2 files, also fix zero life death

This commit is contained in:
Simon 2011-04-04 16:40:22 +01:00
parent 2f91bdb9bc
commit 922befd844
3 changed files with 10 additions and 9 deletions

View File

@ -20,7 +20,7 @@ int update_O2(UPDATE_FUNC_ARGS)
} }
if(pv[y\CELL][x\CELL] > 8.0f) if(pv[y/CELL][x/CELL] > 8.0f)
{ {
for(rx=-2; rx<3; rx++) for(rx=-2; rx<3; rx++)
for(ry=-2; ry<3; ry++) for(ry=-2; ry<3; ry++)
@ -30,9 +30,10 @@ int update_O2(UPDATE_FUNC_ARGS)
if ((r>>8)>=NPART || !r) if ((r>>8)>=NPART || !r)
continue; continue;
if((r&0xFF)==PT_H2) if((r&0xFF)==PT_H2)
if(50<(rand()/(RAND_MAX/100))) if(50<(rand()/(RAND_MAX/100))){
part_change_type(i,x,y,PT_WATR) part_change_type(i,x,y,PT_WATR);
part_change_type(r,rx,rx,PT_WATR) part_change_type(r,rx,rx,PT_WATR);
}
} }
} }

View File

@ -2,7 +2,7 @@
int update_H2(UPDATE_FUNC_ARGS) int update_H2(UPDATE_FUNC_ARGS)
{ {
int r,rx,ry,rt; int r,rx,ry,rt,nx,ny;
for(rx=-2; rx<3; rx++) for(rx=-2; rx<3; rx++)
for(ry=-2; ry<3; ry++) for(ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
@ -11,10 +11,10 @@ int update_H2(UPDATE_FUNC_ARGS)
rt = (r&0xFF); rt = (r&0xFF);
if ((r>>8)>=NPART || !r) if ((r>>8)>=NPART || !r)
continue; continue;
if(pv[y\CELL][x\CELL] > 8.0f && rt == PT_DESL) if(pv[y/CELL][x/CELL] > 8.0f && rt == PT_DESL)
{ {
part_change_type(r,nx,ny,PT_WATR) part_change_type(r,nx,ny,PT_WATR);
part_change_type(i,x,y,PT_OIL) part_change_type(i,x,y,PT_OIL);
} }
} }
} }

View File

@ -1388,7 +1388,7 @@ void update_particles_i(pixel *vid, int start, int inc)
if (!(parts[i].life==10&&(t==PT_SWCH||t==PT_LCRY||t==PT_PCLN||t==PT_HSWC||t==PT_PUMP))) if (!(parts[i].life==10&&(t==PT_SWCH||t==PT_LCRY||t==PT_PCLN||t==PT_HSWC||t==PT_PUMP)))
parts[i].life--; parts[i].life--;
//this if is for stopping death when life hits 0 //this if is for stopping death when life hits 0
if (parts[i].life<=0 && !(ptypes[t].properties&PROP_CONDUCTS) && t!=PT_ARAY && t!=PT_FIRW && t!=PT_SWCH && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_SPRK && t!=PT_LAVA && t!=PT_LCRY && t!=PT_QRTZ && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&!(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST && t!=PT_SHLD1&& t!=PT_SHLD2&& t!=PT_SHLD3&& t!=PT_SHLD4 && t!=PT_SING) if (parts[i].life<=0 && !(ptypes[t].properties&PROP_CONDUCTS) && t!=PT_ARAY && t!=PT_FIRW && t!=PT_SWCH && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_SPRK && t!=PT_LAVA && t!=PT_LCRY && t!=PT_QRTZ && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&!(t==PT_ICEI&&parts[i].ctype==PT_FRZW)&&t!=PT_INST && t!=PT_SHLD1&& t!=PT_SHLD2&& t!=PT_SHLD3&& t!=PT_SHLD4 && t!=PT_SING)
{ {
kill_part(i); kill_part(i);
continue; continue;