summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/gbmb.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/elements/gbmb.c b/src/elements/gbmb.c
index 30baf7b..d1d45b9 100644
--- a/src/elements/gbmb.c
+++ b/src/elements/gbmb.c
@@ -1,23 +1,26 @@
#include <element.h>
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)<NPART)
- if((r&0xFF)!=PT_BOMB&&
- (r&0xFF)!=PT_GBMB&&
- (r&0xFF)!=PT_CLNE&&
- (r&0xFF)!=PT_PCLN&&
- (r&0xFF)!=PT_DMND&&
- !parts[i].tmp){
+ if(!r || (r>>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;
}