From 5d5b8143a41cdd2bc1fe7a136e2370bfc9f61b0a Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Fri, 27 Apr 2012 18:26:37 +0100 Subject: [PATCH] OPS loading: don't replace existing particles twice, and clear soap ctype --- src/save.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/save.c b/src/save.c index df98635ea..0e8c08681 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; }