summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2012-04-27 17:26:37 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2012-04-27 17:28:39 (GMT)
commit5d5b8143a41cdd2bc1fe7a136e2370bfc9f61b0a (patch)
tree85b03a21bd8c0be22ed4fe730fdb04e6b84638f4 /src
parent257c069da19bb4d9365177ad852bc6a154197ce5 (diff)
downloadpowder-5d5b8143a41cdd2bc1fe7a136e2370bfc9f61b0a.zip
powder-5d5b8143a41cdd2bc1fe7a136e2370bfc9f61b0a.tar.gz
OPS loading: don't replace existing particles twice, and clear soap ctype
Diffstat (limited to 'src')
-rw-r--r--src/save.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/save.c b/src/save.c
index df98635..0e8c086 100644
--- a/src/save.c
+++ b/src/save.c
@@ -1141,7 +1141,7 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c
}
if(partsData[i] >= PT_NUM)
partsData[i] = PT_DMND; //Replace all invalid elements with diamond
- if(pmap[y][x])
+ if(pmap[y][x] && posCount==0) // Check posCount to make sure an existing particle is not replaced twice if two particles are saved in that position
{
//Replace existing particle or allocated block
newIndex = pmap[y][x]>>8;
@@ -1284,6 +1284,10 @@ int parse_save_OPS(void *save, int size, int replace, int x0, int y0, unsigned c
STKM_init_legs(&(fighters[fcount]), newIndex);
}
}
+ else if (partsptr[newIndex].type == PT_SOAP)
+ {
+ partsptr[newIndex].ctype = 0;
+ }
if (!ptypes[partsptr[newIndex].type].enabled)
partsptr[newIndex].type = PT_NONE;
}