summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-10-07 18:12:01 (GMT)
committer Simon <simon@hardwired.org.uk>2010-10-07 18:12:01 (GMT)
commit5040b80717cf8f86c6703d9d5c12f4e94bfbb932 (patch)
treeff588c13a91696ef52d78e09f1025afafb713bbc
parent38742f08ba1ea0c5a4f6194bba3949a149825bb2 (diff)
downloadpowder-5040b80717cf8f86c6703d9d5c12f4e94bfbb932.zip
powder-5040b80717cf8f86c6703d9d5c12f4e94bfbb932.tar.gz
Attempt at fixing fuse crashes
-rw-r--r--src/powder.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/powder.c b/src/powder.c
index 8cd0f73..9b008f7 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1352,16 +1352,18 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(t==PT_FUSE)
{
if(parts[i].life<=0) {
- t = PT_NONE;
+ //t = parts[i].life = PT_NONE;
kill_part(i);
r = create_part(-1, x, y, PT_PLSM);
- parts[r].life = 50;
- goto killed;
+ if(r!=-1)
+ parts[r].life = 50;
+ //goto killed;
} else if (parts[i].life < 40) {
parts[i].life--;
if((rand()%100)==0) {
r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM);
- parts[r].life = 50;
+ if(r!=-1)
+ parts[r].life = 50;
}
}
if((pv[y/CELL][x/CELL] > 2.7f)&&parts[i].tmp>40)
@@ -1369,10 +1371,10 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(parts[i].tmp<40&&parts[i].tmp>0)
parts[i].tmp--;
else if(parts[i].tmp<=0) {
- t = PT_NONE;
+ //t = PT_NONE;
kill_part(i);
r = create_part(-1, x, y, PT_FSEP);
- goto killed;
+ //goto killed;
}
for(nx=-2; nx<3; nx++)
for(ny=-2; ny<3; ny++)
@@ -1393,16 +1395,18 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(t==PT_FSEP)
{
if(parts[i].life<=0) {
- t = PT_NONE;
+ //t = PT_NONE;
kill_part(i);
r = create_part(-1, x, y, PT_PLSM);
- parts[r].life = 50;
- goto killed;
+ if(r!=-1)
+ parts[r].life = 50;
+ //goto killed;
} else if (parts[i].life < 40) {
parts[i].life--;
if((rand()%10)==0) {
r = create_part(-1, (nx=x+rand()%3-1), (ny=y+rand()%3-1), PT_PLSM);
- parts[r].life = 50;
+ if(r!=-1)
+ parts[r].life = 50;
}
}
for(nx=-2; nx<3; nx++)