Attempt at fixing fuse crashes
This commit is contained in:
parent
38742f08ba
commit
5040b80717
16
src/powder.c
16
src/powder.c
@ -1352,15 +1352,17 @@ 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);
|
||||
if(r!=-1)
|
||||
parts[r].life = 50;
|
||||
goto killed;
|
||||
//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);
|
||||
if(r!=-1)
|
||||
parts[r].life = 50;
|
||||
}
|
||||
}
|
||||
@ -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,15 +1395,17 @@ 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);
|
||||
if(r!=-1)
|
||||
parts[r].life = 50;
|
||||
goto killed;
|
||||
//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);
|
||||
if(r!=-1)
|
||||
parts[r].life = 50;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user