diff --git a/includes/defines.h b/includes/defines.h index b3b604ff9..967e3f133 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -8,14 +8,12 @@ #endif #define SAVE_VERSION 46 -#define MINOR_VERSION 0 +#define MINOR_VERSION 1 #define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter. -//#define BETA +#define BETA #define SERVER "powdertoy.co.uk" -#undef PLOSS - #define THUMB_CACHE_SIZE 256 #define IMGCONNS 3 @@ -45,11 +43,11 @@ extern unsigned char ZSIZE; #define ISTP (CELL/2) #define CFDS (4.0f/CELL) -#define TSTEPP 0.3f -#define TSTEPV 0.4f -#define VADV 0.3f -#define VLOSS 0.999f -#define PLOSS 0.9999f +#define AIR_TSTEPP 0.3f +#define AIR_TSTEPV 0.4f +#define AIR_VADV 0.3f +#define AIR_VLOSS 0.999f +#define AIR_PLOSS 0.9999f #define GRID_X 5 #define GRID_Y 4 diff --git a/includes/interface.h b/includes/interface.h index 2cb64dd2d..e1d7e6f22 100644 --- a/includes/interface.h +++ b/includes/interface.h @@ -69,6 +69,8 @@ static menu_section msections[] = {"\xC6", "Radioactive", 0, 1}, {"\xCC", "Special", 0, 1}, {"\xD2", "Life", 0, 1}, + {"\xD2", "More Life", 0, 1}, + {"\xC8", "", 0, 0}, {"\xC8", "Cracker", 0, 0}, {"\xC8", "Cracker!", 0, 0}, }; diff --git a/src/air.c b/src/air.c index 33a491376..e9a8b9e93 100644 --- a/src/air.c +++ b/src/air.c @@ -86,8 +86,8 @@ void update_air(void) dp = 0.0f; dp += vx[y][x-1] - vx[y][x]; dp += vy[y-1][x] - vy[y][x]; - pv[y][x] *= PLOSS; - pv[y][x] += dp*TSTEPP; + pv[y][x] *= AIR_PLOSS; + pv[y][x] += dp*AIR_TSTEPP; } for (y=0; y=2 && i=2 && j>8].vy = rand()%8-22; - parts[r>>8].vx = rand()%20-rand()%20; - parts[r>>8].life=rand()%15+25; + parts[np].vy = rand()%8-22; + parts[np].vx = rand()%20-rand()%20; + parts[np].life=rand()%15+25; kill_part(i); return 1; } @@ -33,13 +33,13 @@ int update_FWRK(UPDATE_FUNC_ARGS) { pv[y/CELL][x/CELL] += 2.00f*CFDS; if (np!=-1) { - parts[r>>8].vy = -(rand()%10-1); - parts[r>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[r>>8].life= rand()%37+18; - parts[r>>8].tmp=q; - parts[r>>8].flags=w; - parts[r>>8].ctype=e; - parts[r>>8].temp= rand()%20+6000; + parts[np].vy = -(rand()%10-1); + parts[np].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[np].life= rand()%37+18; + parts[np].tmp=q; + parts[np].flags=w; + parts[np].ctype=e; + parts[np].temp= rand()%20+6000; } } } diff --git a/src/elements/phot.c b/src/elements/phot.c index 11585f9fb..a6a5d0714 100644 --- a/src/elements/phot.c +++ b/src/elements/phot.c @@ -6,7 +6,8 @@ int update_PHOT(UPDATE_FUNC_ARGS) { if (1>rand()%10) update_PYRO(UPDATE_FUNC_SUBCALL_ARGS); for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rx>8)>=NPART || !r) continue; if ((r&0xFF)==PT_ISOZ && 5>(rand()%2000)) diff --git a/src/elements/sprk.c b/src/elements/sprk.c index ddac968c5..f107b9af6 100644 --- a/src/elements/sprk.c +++ b/src/elements/sprk.c @@ -25,6 +25,10 @@ int update_SPRK(UPDATE_FUNC_ARGS) { kill_part(i); return 1; } + else if (ct==PT_NTCT || ct==PT_PTCT) + { + update_NPTCT(UPDATE_FUNC_SUBCALL_ARGS); + } else if (ct==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); @@ -97,12 +101,12 @@ int update_SPRK(UPDATE_FUNC_ARGS) { // ct = spark from material, rt = spark to material. Make conduct_sprk = 0 if conduction not allowed if (pavg == PT_INSL) conduct_sprk = 0; - if (!(ptypes[rt].properties&PROP_CONDUCTS||rt==PT_INST)) conduct_sprk = 0; + if (!(ptypes[rt].properties&PROP_CONDUCTS||rt==PT_INST||rt==PT_QRTZ)) conduct_sprk = 0; if (abs(rx)+abs(ry)>=4 &&ct!=PT_SWCH&&rt!=PT_SWCH) conduct_sprk = 0; - if (ct==PT_METL && (rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR||(rt==PT_SPRK&&(parts[r>>8].ctype==PT_NTCT||parts[r>>8].ctype==PT_PTCT)))) + if (ct==PT_METL && (rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR||(rt==PT_SPRK&&(parts[r>>8].ctype==PT_NTCT||parts[r>>8].ctype==PT_PTCT))) && pavg!=PT_INSL) { parts[r>>8].temp = 473.0f; if (rt==PT_NTCT||rt==PT_PTCT) diff --git a/src/interface.c b/src/interface.c index ab4fa3acf..8b9a9164f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -3965,6 +3965,7 @@ int console_parse_type(char *txt, int *element, char *err) if (strcmp(txt,num)==0) { *element = i; + strcpy(err,""); return 1; } } @@ -3976,12 +3977,14 @@ int console_parse_type(char *txt, int *element, char *err) if (i>=0) { *element = i; + strcpy(err,""); return 1; } for (i=1; i=0 && nx=XRES) { strcpy(err,"Invalid coordinates"); - free(txt); return 0; } - strcpy(num,""); - coordtxt = strtok(NULL, ","); - if (coordtxt) ny = atoi(coordtxt); - if (ny>=0 && ny=YRES) { strcpy(err,"Invalid coordinates"); - free(txt); return 0; } *x = nx; *y = ny; - free(txt); return 1; } int console_parse_partref(char *txt, int *which, char *err) @@ -4044,6 +4035,7 @@ int console_parse_partref(char *txt, int *which, char *err) if (i>=0 && i>8) < NPART && pmr) return parts[pmr>>8].type; else @@ -1113,7 +1113,7 @@ int nearest_part(int ci, int t) { if (parts[i].type==t&&!parts[i].life&&i!=ci) { - ndistance = abs((cx-parts[i].x)+(cy-parts[i].y));// Faster but less accurate Older: sqrt(pow(cx-parts[i].x, 2)+pow(cy-parts[i].y, 2)); + ndistance = abs(cx-parts[i].x)+abs(cy-parts[i].y);// Faster but less accurate Older: sqrt(pow(cx-parts[i].x, 2)+pow(cy-parts[i].y, 2)); if (ndistance=GSPEED)//GSPEED is frames per generation { + int createdsomething = 0; CGOL=0; ISGOL=0; - int createdsomething = 0; for (nx=CELL; nx-1 && ptransitions[t].tht-1 && ptransitions[t].tltptransitions[t].thv&&ptransitions[t].tht>-1) { + if (ctemph>ptransitions[t].thv&&ptransitions[t].tht>-1) { // particle type change due to high temperature if (ptransitions[t].tht!=PT_NUM) t = ptransitions[t].tht; @@ -1544,7 +1552,7 @@ void update_particles_i(pixel *vid, int start, int inc) else t = PT_WTRV; } else s = 0; - } else if (pt-1) { + } else if (ctempl-1) { // particle type change due to low temperature if (ptransitions[t].tlt!=PT_NUM) t = ptransitions[t].tlt; @@ -1553,7 +1561,7 @@ void update_particles_i(pixel *vid, int start, int inc) else t = PT_DSTW; } else if (t==PT_LAVA) { - if (parts[i].ctype&&parts[i].ctype!=PT_LAVA) { + if (parts[i].ctype && parts[i].ctype=ptransitions[parts[i].ctype].thv) s = 0; else if (parts[i].ctype==PT_THRM&&pt>=ptransitions[PT_BMTL].thv) s = 0; else if (pt>=973.0f) s = 0; // freezing point for lava with any other (not listed in ptransitions as turning into lava) ctype