summaryrefslogtreecommitdiff
path: root/src/elements/thrm.c
diff options
context:
space:
mode:
authorjacksonmj <jacksonmj@jacksonmj.none>2011-01-09 19:23:05 (GMT)
committer jacksonmj <jacksonmj@jacksonmj.none>2011-01-09 19:23:05 (GMT)
commit144e4bdb6991a042f9b985a9719299f612420dd0 (patch)
tree3da5132fc731dea1334048c707f4c074e390a86c /src/elements/thrm.c
parent56a3ad373c126da22be05e4c5b64a446c7d7dff0 (diff)
downloadpowder-144e4bdb6991a042f9b985a9719299f612420dd0.zip
powder-144e4bdb6991a042f9b985a9719299f612420dd0.tar.gz
Begin cleanup of update functions
Diffstat (limited to 'src/elements/thrm.c')
-rw-r--r--src/elements/thrm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/elements/thrm.c b/src/elements/thrm.c
index 3d82d46..41ecf94 100644
--- a/src/elements/thrm.c
+++ b/src/elements/thrm.c
@@ -1,23 +1,23 @@
#include <powder.h>
int update_THRM(UPDATE_FUNC_ARGS) {
- int r;
- for (nx=-2; nx<3; nx++)
- for (ny=-2; ny<3; ny++)
- if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
+ int r, rx, ry;
+ 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))
{
- r = pmap[y+ny][x+nx];
+ r = pmap[y+ry][x+rx];
if ((r>>8)>=NPART || !r)
continue;
- if (((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_LAVA))
+ if (((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_LAVA)) // TODO: could this go in update_PYRO?
{
if (1>(rand()%500)) {
- parts[i].type = PT_LAVA;
+ part_change_type(i,x,y,PT_LAVA);
parts[i].ctype = PT_BMTL;
parts[i].temp = 3500.0f;
pv[y/CELL][x/CELL] += 50.0f;
} else {
- parts[i].type = PT_LAVA;
+ part_change_type(i,x,y,PT_LAVA);
parts[i].life = 400;
parts[i].ctype = PT_THRM;
parts[i].temp = 3500.0f;