Set BIZR/G/S ctype when loading a save, set BIZS ctype in create_part
This commit is contained in:
parent
f9603fd4a9
commit
20dd54f36e
37
src/main.c
37
src/main.c
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user