summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorjacksonmj <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)
commit1713604233a4090f7f73ba86c33e72dd3c44d13c (patch)
tree4cffce37172552bf1511ebf9026352782495dcdb /src/main.c
parent61bbc36cfaca3640b86dfe0bc21e02eab5a32d80 (diff)
downloadpowder-1713604233a4090f7f73ba86c33e72dd3c44d13c.zip
powder-1713604233a4090f7f73ba86c33e72dd3c44d13c.tar.gz
Skip unused particles at end of parts[]
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index db9a0b8..c2653a5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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));