Set BIZR/G/S ctype when loading a save, set BIZS ctype in create_part

This commit is contained in:
jacksonmj 2011-12-10 16:29:23 +08:00 committed by Simon Robertshaw
parent f9603fd4a9
commit 20dd54f36e
2 changed files with 21 additions and 24 deletions

View File

@ -724,36 +724,33 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
if (pmap[y][x])
{
k = pmap[y][x]>>8;
}
else if (i<nf)
{
k = fp[i];
i++;
}
else
{
m[(x-x0)+(y-y0)*w] = NPART+1;
continue;
}
memset(parts+k, 0, sizeof(particle));
parts[k].type = j;
if (j == PT_COAL)
parts[k].tmp = 50;
if (j == PT_FUSE)
parts[k].tmp = 50;
if (j == PT_PHOT)
parts[k].ctype = 0x3fffffff;
if (j == PT_SOAP)
parts[k].ctype = 0;
if (j==PT_BIZR || j==PT_BIZRG || j==PT_BIZRS)
parts[k].ctype = 0x47FFFF;
parts[k].x = (float)x;
parts[k].y = (float)y;
m[(x-x0)+(y-y0)*w] = k+1;
}
else if (i < nf)
{
memset(parts+fp[i], 0, sizeof(particle));
parts[fp[i]].type = j;
if (j == PT_COAL)
parts[fp[i]].tmp = 50;
if (j == PT_FUSE)
parts[fp[i]].tmp = 50;
if (j == PT_PHOT)
parts[fp[i]].ctype = 0x3fffffff;
if (j == PT_SOAP)
parts[fp[i]].ctype = 0;
parts[fp[i]].x = (float)x;
parts[fp[i]].y = (float)y;
m[(x-x0)+(y-y0)*w] = fp[i]+1;
i++;
}
else
m[(x-x0)+(y-y0)*w] = NPART+1;
}
}
// load particle properties

View File

@ -1070,7 +1070,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
}
return -1;
}
if (t==PT_BIZR||t==PT_BIZRG)
if (t==PT_BIZR||t==PT_BIZRG||t==PT_BIZRS)
parts[i].ctype = 0x47FFFF;
//and finally set the pmap/photon maps to the newly created particle
if (t==PT_PHOT||t==PT_NEUT||t==PT_ELEC)