diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-08-09 21:59:04 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-10 23:38:56 (GMT) |
| commit | 1713604233a4090f7f73ba86c33e72dd3c44d13c (patch) | |
| tree | 4cffce37172552bf1511ebf9026352782495dcdb /src/main.c | |
| parent | 61bbc36cfaca3640b86dfe0bc21e02eab5a32d80 (diff) | |
| download | powder-1713604233a4090f7f73ba86c33e72dd3c44d13c.zip powder-1713604233a4090f7f73ba86c33e72dd3c44d13c.tar.gz | |
Skip unused particles at end of parts[]
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -546,6 +546,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char int nf=0, new_format = 0, ttv = 0; particle *parts = partsptr; int *fp = malloc(NPART*sizeof(int)); + parts_lastActiveIndex = NPART-1; //New file header uses PSv, replacing fuC. This is to detect if the client uses a new save format for temperatures //This creates a problem for old clients, that display and "corrupt" error instead of a "newer version" error @@ -1129,6 +1130,7 @@ void clear_sim(void) memset(signs, 0, sizeof(signs)); memset(parts, 0, sizeof(particle)*NPART); pfree = -1; + parts_lastActiveIndex = NPART-1; memset(pmap, 0, sizeof(pmap)); memset(pv, 0, sizeof(pv)); memset(vx, 0, sizeof(vx)); |
