diff options
Diffstat (limited to 'src/elements/prti.c')
| -rw-r--r-- | src/elements/prti.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/elements/prti.c b/src/elements/prti.c index ff9f459..4d3a4be 100644 --- a/src/elements/prti.c +++ b/src/elements/prti.c @@ -1,28 +1,27 @@ #include <powder.h> int update_PRTI(UPDATE_FUNC_ARGS) { - int r, nnx; + int r, nnx, rx, ry; int count =0; parts[i].tmp = (int)((parts[i].temp-73.15f)/100+1); - for (ny=-1; ny<2; ny++) - for (nx=-1; nx<2; nx++) - if (x+nx>=0 && y+ny>0 && - x+nx<XRES && y+ny<YRES && (nx || ny)) + for (rx=-1; rx<2; rx++) + for (ry=-1; ry<2; ry++) + if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) { + r = pmap[y+ry][x+rx]; count ++; - r = pmap[y+ny][x+nx]; if ((r>>8)>=NPART || !r) continue; - if (parts[r>>8].type==PT_SPRK || (parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS))) + if ((r&0xFF)==PT_SPRK || ((r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO && (ptypes[r&0xFF].falldown!= 0 || pstates[r&0xFF].state == ST_GAS))) for ( nnx=0; nnx<80; nnx++) if (!portal[parts[i].tmp][count-1][nnx]) { portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type; portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp; if (parts[r>>8].type==PT_SPRK) - parts[r>>8].type = parts[r>>8].ctype; + part_change_type(r>>8,x+rx,y+ry,parts[r>>8].ctype); else - parts[r>>8].type = PT_NONE; + kill_part(r>>8); break; } } |
