diff --git a/src/elements/bcln.c b/src/elements/bcln.c index 36ad347d0..aaf4afced 100644 --- a/src/elements/bcln.c +++ b/src/elements/bcln.c @@ -11,18 +11,21 @@ int update_BCLN(UPDATE_FUNC_ARGS) { } if (!parts[i].ctype) { - int rx, ry; + int r, rx, ry; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rx>8)>=NPART) + r = pmap[y+ry][x+rx]; + if (!r || (r>>8)>=NPART) + continue; + if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && + (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM && + (r&0xFF)!=PT_STKM2 && (r&0xFF)=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rx>8)>=NPART) + r = pmap[y+ry][x+rx]; + if (!r || (r>>8)>=NPART) + continue; + if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && + (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM && + (r&0xFF)!=PT_STKM2 && (r&0xFF)>8].type-1].menusection==SC_POWDERS) && 15>(rand()%1000)) parts[r>>8].type--;*/ } - r = pmap[y][x]; - rt = r&0xFF; - if (rt==PT_CLNE || rt==PT_PCLN || rt==PT_BCLN) { - if (!parts[r>>8].ctype) - parts[r>>8].ctype = PT_PHOT; - } return 0; } diff --git a/src/elements/pcln.c b/src/elements/pcln.c index e1c688e1e..5abe33fcc 100644 --- a/src/elements/pcln.c +++ b/src/elements/pcln.c @@ -27,18 +27,20 @@ int update_PCLN(UPDATE_FUNC_ARGS) { if (!parts[i].ctype) for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rx>8)>=NPART) + r = pmap[y+ry][x+rx]; + if (!r || (r>>8)>=NPART) + continue; + if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && + (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_SPRK && + (r&0xFF)!=PT_NSCN && (r&0xFF)!=PT_PSCN && + (r&0xFF)!=PT_STKM && (r&0xFF)!=PT_STKM2 && + (r&0xFF)>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); } + if (parts[i].type==PT_NEUT && ((r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_BCLN)) { + if (!parts[r>>8].ctype) + parts[r>>8].ctype = PT_NEUT; + } return 0; } @@ -250,7 +254,8 @@ int try_move(int i, int x, int y, int nx, int ny) return 0; } - if ((r&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles + + if ((pmap[ny][nx]&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles return 0; if (parts[i].type==PT_CNCT && y