summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-08-18 12:44:09 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-08-19 11:23:38 (GMT)
commit961a393c7a20166277c10aebde43e7563951773a (patch)
tree835f2ba00af186cd8577ad0edbecf2569700a4b9 /src/elements
parent34abbcc84ccbefac065a8c7afd62ce272b3e51ec (diff)
downloadpowder-961a393c7a20166277c10aebde43e7563951773a.zip
powder-961a393c7a20166277c10aebde43e7563951773a.tar.gz
Modify GBMB to only use life
tmp not needed, since it doesn't create powder during an explosion like BOMB does.
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;
}