From 16ae9a9b595ae7528344ea46f462f8105a34a79e Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sat, 10 Sep 2011 19:37:33 +0100 Subject: Small changes to STOR, prevent setting Ctype to solid from cursor, allow any type when ctype not set and correct discharge location bias diff --git a/src/elements/stor.c b/src/elements/stor.c index 1f2558f..42802a4 100644 --- a/src/elements/stor.c +++ b/src/elements/stor.c @@ -11,7 +11,7 @@ int update_STOR(UPDATE_FUNC_ARGS) { r = pmap[y+ry][x+rx]; if ((r>>8)>=NPART || !r) 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].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) { - for(rx1 = 1; rx1 >= -1; rx1--){ - 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(ry1 = 1; ry1 >= -1; ry1--){ + 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); if (np!=-1) { diff --git a/src/powder.c b/src/powder.c index 4902b75..0854217 100644 --- a/src/powder.c +++ b/src/powder.c @@ -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]&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_BCLN|| (pmap[y][x]&0xFF)==PT_CONV|| -- cgit v0.9.2-21-gd62e