summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2011-04-04 15:40:22 (GMT)
committer Simon <simon@hardwired.org.uk>2011-04-04 15:40:22 (GMT)
commit922befd8446ae3bdc8b3105bcf2f74e956ea386d (patch)
treea087cd1e1fc765e8eebfeb3c9da2856562462333 /src/elements
parent2f91bdb9bca011f354d0f9b752b915b3c4f88384 (diff)
downloadpowder-922befd8446ae3bdc8b3105bcf2f74e956ea386d.zip
powder-922befd8446ae3bdc8b3105bcf2f74e956ea386d.tar.gz
Fix O2 and H2 files, also fix zero life death
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/O2.c9
-rw-r--r--src/elements/h2.c8
2 files changed, 9 insertions, 8 deletions
diff --git a/src/elements/O2.c b/src/elements/O2.c
index 4c019d3..090ea33 100644
--- a/src/elements/O2.c
+++ b/src/elements/O2.c
@@ -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(ry=-2; ry<3; ry++)
@@ -30,9 +30,10 @@ int update_O2(UPDATE_FUNC_ARGS)
if ((r>>8)>=NPART || !r)
continue;
if((r&0xFF)==PT_H2)
- if(50<(rand()/(RAND_MAX/100)))
- part_change_type(i,x,y,PT_WATR)
- part_change_type(r,rx,rx,PT_WATR)
+ if(50<(rand()/(RAND_MAX/100))){
+ part_change_type(i,x,y,PT_WATR);
+ part_change_type(r,rx,rx,PT_WATR);
+ }
}
}
diff --git a/src/elements/h2.c b/src/elements/h2.c
index 8e83ecd..7340bab 100644
--- a/src/elements/h2.c
+++ b/src/elements/h2.c
@@ -2,7 +2,7 @@
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(ry=-2; ry<3; 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);
if ((r>>8)>=NPART || !r)
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(i,x,y,PT_OIL)
+ part_change_type(r,nx,ny,PT_WATR);
+ part_change_type(i,x,y,PT_OIL);
}
}
}