diff options
| author | Jacob1 <jfu614@gmail.com> | 2012-05-24 16:42:19 (GMT) |
|---|---|---|
| committer | Jacob1 <jfu614@gmail.com> | 2012-05-24 16:42:19 (GMT) |
| commit | f49f4ea2413464ebdfac6ee0be32c1b282839c63 (patch) | |
| tree | 137bea08f733a03f4a12f57137ab93e99b452166 /src/main.c | |
| parent | 4368ded19707c4272a31210503da7c123db24b63 (diff) | |
| download | powder-f49f4ea2413464ebdfac6ee0be32c1b282839c63.zip powder-f49f4ea2413464ebdfac6ee0be32c1b282839c63.tar.gz | |
fix crash, spark reset set type without checking if it was a valid number. Also disable another way to create invalid elements
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1526,8 +1526,13 @@ int main(int argc, char *argv[]) for (i=0; i<NPART; i++) if (parts[i].type==PT_SPRK) { - parts[i].type = parts[i].ctype; - parts[i].life = 0; + if (parts[i].ctype >= 0 && parts[i].ctype < PT_NUM) + { + parts[i].type = parts[i].ctype; + parts[i].life = 0; + } + else + kill_part(i); } } else |
