summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/powder.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index 2a72fee..853914d 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -831,7 +831,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
if (t==goltype[r])
parts[i].tmp = grule[r+1][9] - 1;
}*/
- if (t==PT_LIFE)
+ if (t==PT_LIFE && v<NGOLALT)
{
parts[i].tmp = grule[v+1][9] - 1;
parts[i].ctype = v;
@@ -1486,6 +1486,10 @@ void update_particles_i(pixel *vid, int start, int inc)
if (parts[r>>8].type==PT_LIFE/* && parts[r>>8].ctype==golnum-1*/)
{
golnum = parts[r>>8].ctype+1;
+ if (golnum<=0 || golnum>NGOLALT) {
+ parts[r>>8].type = PT_NONE;
+ continue;
+ }
if (parts[r>>8].tmp == grule[golnum][9]-1) {
gol[nx][ny] = golnum;
for ( nnx=-1; nnx<2; nnx++)