summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-05-11 21:32:29 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-14 12:44:22 (GMT)
commit203c3a0151b10ef6d8824c4eff351d1771c2afb8 (patch)
tree6e198e1e6dead28dfdf9c2f4edca95b22c7791e1 /src
parent7fe99f32102429113c671615fc2c5cadb9c51e56 (diff)
downloadpowder-203c3a0151b10ef6d8824c4eff351d1771c2afb8.zip
powder-203c3a0151b10ef6d8824c4eff351d1771c2afb8.tar.gz
Translate invisible particles to decorated diamond when loading
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 6359d00..eac930a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -873,6 +873,18 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
else
p++;
}
+ // no more particle properties to load, so we can change type here without messing up loading
+ if (i && i<=NPART)
+ {
+ if (ver<48 && (ty==OLD_PT_WIND || (ty==PT_BRAY&&parts[i-1].life==0)))
+ {
+ // Replace invisible particles with something sensible and add decoration to hide it
+ x = (int)(parts[i-1].x+0.5f);
+ y = (int)(parts[i-1].y+0.5f);
+ decorations[y*(XRES+BARSIZE)+x] = PIXPACK(0x010101);
+ parts[i-1].type = PT_DMND;
+ }
+ }
}
if (p >= size)