Small changes to STOR, prevent setting Ctype to solid from cursor, allow any type when ctype not set and correct discharge location bias

This commit is contained in:
Simon Robertshaw 2011-09-10 19:37:33 +01:00
parent 49a164b7ba
commit 16ae9a9b59
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ int update_STOR(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
if ((r>>8)>=NPART || !r) if ((r>>8)>=NPART || !r)
continue; continue;
if (!parts[i].tmp && !parts[i].life && (r&0xFF)!=PT_STOR && (r&0xFF)==parts[i].ctype && !(ptypes[(r&0xFF)].properties&TYPE_SOLID)) if (!parts[i].tmp && !parts[i].life && (r&0xFF)!=PT_STOR && !(ptypes[(r&0xFF)].properties&TYPE_SOLID) && (!parts[i].ctype || (r&0xFF)==parts[i].ctype))
{ {
parts[i].tmp = parts[r>>8].type; parts[i].tmp = parts[r>>8].type;
parts[i].temp = parts[r>>8].temp; parts[i].temp = parts[r>>8].temp;
@ -22,8 +22,8 @@ int update_STOR(UPDATE_FUNC_ARGS) {
} }
if(parts[i].tmp && (r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_PSCN) if(parts[i].tmp && (r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_PSCN)
{ {
for(rx1 = 1; rx1 >= -1; rx1--){ for(ry1 = 1; ry1 >= -1; ry1--){
for(ry1 = 0; ry1 >= -1 && ry1 <= 1; ry1 = -ry1-ry1+1){ // Oscilate the Y starting at 0, 1, -1, 3, -5, etc (Though stop at -1) for(rx1 = 0; rx1 >= -1 && rx1 <= 1; rx1 = -rx1-rx1+1){ // Oscilate the X starting at 0, 1, -1, 3, -5, etc (Though stop at -1)
np = create_part(-1,x+rx1,y+ry1,parts[i].tmp); np = create_part(-1,x+rx1,y+ry1,parts[i].tmp);
if (np!=-1) if (np!=-1)
{ {

View File

@ -771,7 +771,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
if (pmap[y][x]) if (pmap[y][x])
{ {
if (( if ((
(pmap[y][x]&0xFF)==PT_STOR|| ((pmap[y][x]&0xFF)==PT_STOR&&!(ptypes[t].properties&TYPE_SOLID))||
(pmap[y][x]&0xFF)==PT_CLNE|| (pmap[y][x]&0xFF)==PT_CLNE||
(pmap[y][x]&0xFF)==PT_BCLN|| (pmap[y][x]&0xFF)==PT_BCLN||
(pmap[y][x]&0xFF)==PT_CONV|| (pmap[y][x]&0xFF)==PT_CONV||