diff --git a/src/elements/gbmb.c b/src/elements/gbmb.c index 30baf7b7c..d1d45b956 100644 --- a/src/elements/gbmb.c +++ b/src/elements/gbmb.c @@ -1,23 +1,26 @@ #include int update_GBMB(UPDATE_FUNC_ARGS) { int rx,ry,r; - for (rx=-2; rx<3; rx++) - for (ry=-2; ry<3; ry++){ + if (parts[i].life<=0) + { + for (rx=-2; rx<3; rx++) + for (ry=-2; ry<3; ry++) + { r = pmap[y+ry][x+rx]; - if(r && (r>>8)>8)>=NPART) + continue; + if((r&0xFF)!=PT_BOMB && (r&0xFF)!=PT_GBMB && + (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && + (r&0xFF)!=PT_DMND) + { parts[i].life=60; - parts[i].tmp = 1; - } + break; } + } + } if(parts[i].life>20) - gravmap[y/CELL][x/CELL] = 20; + gravmap[y/CELL][x/CELL] = 20; if(parts[i].life<20 && parts[i].life>=1) - gravmap[y/CELL][x/CELL] = -80; -return 0; + gravmap[y/CELL][x/CELL] = -80; + return 0; } diff --git a/src/graphics.c b/src/graphics.c index 6225c6f09..233a17854 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -3255,7 +3255,7 @@ void draw_parts(pixel *vid) } else if (t==PT_GBMB) { - if (parts[i].tmp==0) { + if (parts[i].life<=0) {//not yet detonated cr = PIXR(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors); cb = PIXB(ptypes[t].pcolors); @@ -3285,7 +3285,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } } - else if (parts[i].tmp==1) { + else {//exploding cr = PIXR(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors); cb = PIXB(ptypes[t].pcolors); @@ -3305,10 +3305,6 @@ void draw_parts(pixel *vid) blendpixel(vid, nx, ny, cr, cg, cb, 255); } } - else { - blendpixel(vid, nx, ny, 255, 255, 255, 255); - } - } else if (ptypes[t].properties&PROP_HOT_GLOW && parts[i].temp>(ptransitions[t].thv-800.0f)) { diff --git a/src/powder.c b/src/powder.c index abff1163b..9433aea89 100644 --- a/src/powder.c +++ b/src/powder.c @@ -336,6 +336,9 @@ int try_move(int i, int x, int y, int nx, int ny) if ((bmap[y/CELL][x/CELL]==WL_EHOLE && !emap[y/CELL][x/CELL]) && !(bmap[ny/CELL][nx/CELL]==WL_EHOLE && !emap[ny/CELL][nx/CELL])) return 0; + if(parts[i].type==PT_GBMB&&parts[i].life>0) + return 0; + e = r >> 8; //e is now the particle number at r (pmap[ny][nx]) if (r && e