From 1755f08e44b4a8a6bc60bc5c92fbc7fff558f32a Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Thu, 3 Feb 2011 16:38:58 -0500 Subject: [PATCH 1/7] variables and if statements for scripts, GoL is glitchy for me, i don't know why --- src/interface.c | 4 ++ src/main.c | 121 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 118 insertions(+), 7 deletions(-) diff --git a/src/interface.c b/src/interface.c index 298957113..346c92394 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 && i Date: Thu, 3 Feb 2011 17:28:08 -0500 Subject: [PATCH 2/7] missed some corrections, fixes GoL --- includes/defines.h | 4 ++-- includes/powder.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index 95302fad4..b3b604ff9 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -61,7 +61,7 @@ extern unsigned char ZSIZE; #define STAMP_Y 4 #define STAMP_MAX 120 -#define NGOL 26 +#define NGOL 25 #define CIRCLE_BRUSH 0 #define SQUARE_BRUSH 1 @@ -136,7 +136,7 @@ int GSPEED; int love[XRES/9][YRES/9]; int lolz[XRES/9][YRES/9]; int gol[XRES][YRES]; -int gol2[XRES][YRES][NGOL]; +int gol2[XRES][YRES][NGOL+1]; int SEC; int SEC2; int console_mode; diff --git a/includes/powder.h b/includes/powder.h index 91d8f1fa2..b09ad5ead 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -405,7 +405,7 @@ static const part_type ptypes[PT_NUM] = {"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", ST_SOLID, TYPE_SOLID, NULL}, {"MWAX", PIXPACK(0xE0E0AA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 5, 0, 0, 2, 1, 25, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax.", ST_LIQUID, TYPE_LIQUID, NULL}, {"PSCN", PIXPACK(0x805050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "P-Type Silicon, Will transfer current to any conductor.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS, NULL}, - {"NSCN", PIXPACK(0x505080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will only transfer current to P-Type Silicon.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS, NULL}, + {"NSCN", PIXPACK(0x505080), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "N-Type Silicon, Will not transfer current to P-Type Silicon.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS, NULL}, {"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", ST_SOLID, TYPE_LIQUID, NULL}, {"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity.", ST_SOLID, TYPE_SOLID, NULL}, {"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up.", ST_NONE, TYPE_SOLID, NULL}, @@ -687,7 +687,7 @@ static part_transition ptransitions[PT_NUM] = #undef ST -static int grule[NGOL][10] = +static int grule[NGOL+1][10] = { // 0,1,2,3,4,5,6,7,8,STATES live=1 spawn=2 spawn&live=3 States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing {0,0,0,0,0,0,0,0,0,2},//blank From 9064cabf288be8ecb2fbc1c15bb4071cf3df1c22 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Fri, 4 Feb 2011 01:00:03 -0500 Subject: [PATCH 3/7] merge jacksonmj's and much better string parsing because of a function i found. --- includes/defines.h | 12 +++++------ includes/interface.h | 2 ++ src/air.c | 32 ++++++++++++++-------------- src/elements/fwrk.c | 20 +++++++++--------- src/elements/phot.c | 3 ++- src/elements/sprk.c | 8 +++++-- src/interface.c | 18 +++------------- src/main.c | 50 +++++++------------------------------------- src/powder.c | 22 ++++++++++++------- 9 files changed, 66 insertions(+), 101 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index b3b604ff9..9fba0fb2e 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -14,8 +14,6 @@ #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 346c92394..31d885a03 100644 --- a/src/interface.c +++ b/src/interface.c @@ -3994,32 +3994,20 @@ int console_parse_type(char *txt, int *element, char *err) int console_parse_coords(char *txt, int *x, int *y, char *err) { // TODO: use regex? - char *coordtxt; - char num[10] = ""; int nx = -1, ny = -1; - txt = mystrdup(txt); - coordtxt = strtok(txt, ","); - if (coordtxt) nx = atoi(coordtxt); - if (nx>=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) diff --git a/src/main.c b/src/main.c index 38669fc2f..3358a333c 100644 --- a/src/main.c +++ b/src/main.c @@ -2631,17 +2631,14 @@ int x,y,nx,ny,i,j,k,m; int do_next = 1; char xcoord[10]; char ycoord[10]; -char *console2; -char *console3; -char *console4; -char *console5; +char console2[15]; +char console3[15]; +char console4[15]; +char console5[15]; //sprintf(console_error, "%s", console); if(console && strcmp(console, "")!=0 && strncmp(console, " ", 1)!=0) { - console2 = strtok(console, " "); - console3 = strtok(NULL, " "); - console4 = strtok(NULL, " "); - console5 = strtok(NULL, " "); + sscanf(console,"%s %s %s %s", console2, console3, console4, console5);//why didn't i know about this function?! if(strcmp(console2, "quit")==0) { return -1; @@ -2681,41 +2678,8 @@ char *console5; tokensize = strlen(tokens); x = 0; y = 0; - strcpy(xcoord,strtok(tokens,",")); - strcpy(ycoord,strtok(NULL," ")); - if(xcoord[1]=='+')//get additions - { - for(k = 2; k>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 From dd5ca12223db92a9a9731e6dfd31708af724025c Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2011 11:42:11 +0000 Subject: [PATCH 4/7] We don't want any buffer overflow, especially when reading file and user input --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 70bb47ed2..8c3afd74d 100644 --- a/src/main.c +++ b/src/main.c @@ -2637,7 +2637,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { //sprintf(console_error, "%s", console); if(console && strcmp(console, "")!=0 && strncmp(console, " ", 1)!=0) { - sscanf(console,"%s %s %s %s", console2, console3, console4, console5);//why didn't i know about this function?! + sscanf(console,"%14s %14s %14s %14s", console2, console3, console4, console5);//why didn't i know about this function?! if(strcmp(console2, "quit")==0) { return -1; @@ -2678,7 +2678,7 @@ int process_command(pixel *vid_buf,char *console,char *console_error) { x = 0; y = 0; sscanf(tokens,"x%d,y%d",&x,&y); - sscanf(tokens,"%s,%s",xcoord,ycoord); + sscanf(tokens,"%9s,%9s",xcoord,ycoord); x += nx; y += ny; sprintf(xcoord,"%d",x); From aef66fbfe3738924a3c7a39d53693df60dd2867a Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2011 12:16:45 +0000 Subject: [PATCH 5/7] Session checking on startup and compatibility fixes --- src/main.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- src/misc.c | 27 +++++++++++-------- 2 files changed, 91 insertions(+), 13 deletions(-) diff --git a/src/main.c b/src/main.c index 8c3afd74d..69aa5a8d6 100644 --- a/src/main.c +++ b/src/main.c @@ -1181,9 +1181,10 @@ int main(int argc, char *argv[]) pixel *vid_buf=calloc((XRES+BARSIZE)*(YRES+MENUSIZE), PIXELSIZE); pixel *pers_bg=calloc((XRES+BARSIZE)*YRES, PIXELSIZE); void *http_ver_check; - char *ver_data=NULL, *tmp; + void *http_session_check; + char *ver_data=NULL, *check_data=NULL, *tmp; char console_error[255] = ""; - int i, j, bq, fire_fc=0, do_check=0, old_version=0, http_ret=0, major, minor, old_ver_len; + int i, j, bq, fire_fc=0, do_check=0, do_s_check=0, old_version=0, http_ret=0,http_s_ret=0, major, minor, old_ver_len; #ifdef INTERNAL int vs = 0; #endif @@ -1285,6 +1286,10 @@ int main(int argc, char *argv[]) #else http_ver_check = http_async_req_start(NULL, "http://" SERVER "/Update.api?Action=CheckVersion", NULL, 0, 0); #endif + if(svf_login){ + http_session_check = http_async_req_start(NULL, "http://" SERVER "/Login.api?Action=CheckSession", NULL, 0, 0); + http_auth_headers(http_session_check, svf_user_id, NULL, svf_session_id); + } while (!sdl_poll()) { @@ -1367,6 +1372,74 @@ int main(int argc, char *argv[]) } do_check = (do_check+1) & 15; } + if(http_session_check) + { + if(!do_s_check && http_async_req_status(http_session_check)) + { + check_data = http_async_req_stop(http_session_check, &http_s_ret, NULL); + if(http_ret==200 && check_data) + { + printf("{%s}\n", check_data); + if(!strncmp(check_data, "EXPIRED", 7)) + { + //Session expired + strcpy(svf_user, ""); + strcpy(svf_pass, ""); + strcpy(svf_user_id, ""); + strcpy(svf_session_id, ""); + svf_login = 0; + svf_own = 0; + svf_admin = 0; + svf_mod = 0; + } + else if(!strncmp(check_data, "BANNED", 6)) + { + //User banned + strcpy(svf_user, ""); + strcpy(svf_pass, ""); + strcpy(svf_user_id, ""); + strcpy(svf_session_id, ""); + svf_login = 0; + svf_own = 0; + svf_admin = 0; + svf_mod = 0; + } + else if(!strncmp(check_data, "OK", 2)) + { + //Session valid + if(strlen(check_data)>2){ + //User is elevated + if (!strncmp(check_data+3, "ADMIN", 5)) + { + svf_admin = 1; + svf_mod = 0; + } + else if (!strncmp(check_data+3, "MOD", 3)) + { + svf_admin = 0; + svf_mod = 1; + } + } + save_presets(0); + } + else + { + //No idea, but log the user out anyway + strcpy(svf_user, ""); + strcpy(svf_pass, ""); + strcpy(svf_user_id, ""); + strcpy(svf_session_id, ""); + svf_login = 0; + svf_own = 0; + svf_admin = 0; + svf_mod = 0; + } + free(check_data); + } + http_session_check = NULL; + } + do_s_check = (do_s_check+1) & 15; + } if (sdl_key=='q' || sdl_key==SDLK_ESCAPE) { diff --git a/src/misc.c b/src/misc.c index 702ff0378..c98c5a3c0 100644 --- a/src/misc.c +++ b/src/misc.c @@ -92,7 +92,7 @@ void strlist_free(struct strlist **list) void save_presets(int do_update) { FILE *f=fopen("powder.def", "wb"); - unsigned char sig[4] = {0x50, 0x44, 0x65, 0x66}; + unsigned char sig[4] = {0x50, 0x44, 0x65, 0x67}; unsigned char tmp = sdl_scale; if (!f) return; @@ -136,7 +136,7 @@ void load_presets(void) if (!f) return; fread(sig, 1, 4, f); - if (sig[0]!=0x50 || sig[1]!=0x44 || sig[2]!=0x65 || sig[3]!=0x66) + if (sig[0]!=0x50 || sig[1]!=0x44 || sig[2]!=0x65) { if (sig[0]==0x4D && sig[1]==0x6F && sig[2]==0x46 && sig[3]==0x6F) { @@ -158,15 +158,20 @@ void load_presets(void) remove("powder.def"); return; } - if (load_string(f, svf_user, 63)) - goto fail; - //if (load_string(f, svf_pass, 63)) - //goto fail; - if (load_string(f, svf_user_id, 63)) - goto fail; - if (load_string(f, svf_session_id, 63)) - goto fail; - svf_login = !!svf_user[0]; + if(sig[3]==0x66){ + if (load_string(f, svf_user, 63)) + goto fail; + if (load_string(f, svf_pass, 63)) + goto fail; + } else { + if (load_string(f, svf_user, 63)) + goto fail; + if (load_string(f, svf_user_id, 63)) + goto fail; + if (load_string(f, svf_session_id, 63)) + goto fail; + } + svf_login = !!svf_session_id[0]; if (fread(&tmp, 1, 1, f) != 1) goto fail; sdl_scale = (tmp == 2) ? 2 : 1; From 0d863dce941874f6a3e064bc07290d2e91557159 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2011 12:17:24 +0000 Subject: [PATCH 6/7] Nobody likes extra line breaks] --- src/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface.c b/src/interface.c index 8b9a9164f..e321d130a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -867,7 +867,7 @@ void login_ui(pixel *vid_buf) if (res && !strncmp(res, "OK ", 3)) { char *s_id,*u_e,*nres; - printf("\n{%s}\n", res); + printf("{%s}\n", res); s_id = strchr(res+3, ' '); if (!s_id) goto fail; @@ -885,7 +885,7 @@ void login_ui(pixel *vid_buf) strcpy(svf_session_id, s_id); nres = mystrdup(u_e); - printf("\n{%s} {%s} {%s}\n", svf_user_id, svf_session_id, nres); + printf("{%s} {%s} {%s}\n", svf_user_id, svf_session_id, nres); if (!strncmp(nres, "ADMIN", 5)) { From bb3964138cb664b0c9ced741441863bb0c03c556 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 4 Feb 2011 13:09:48 +0000 Subject: [PATCH 7/7] Fix Antimatter --- includes/powder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/powder.h b/includes/powder.h index b09ad5ead..1b2824ecc 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -441,7 +441,7 @@ static const part_type ptypes[PT_NUM] = {"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 55, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!", ST_SOLID, TYPE_PART, &update_FIRW}, {"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.", ST_SOLID, TYPE_SOLID, &update_FUSE}, {"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 70, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE.", ST_SOLID, TYPE_PART, &update_FSEP}, - {"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles", ST_NONE, TYPE_PART, NULL}, //Maybe TYPE_ENERGY? + {"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles", ST_NONE, TYPE_PART, &update_AMTR}, //Maybe TYPE_ENERGY? {"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", ST_SOLID, TYPE_PART, &update_BCOL}, {"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When activated, duplicates any particles it touches.", ST_NONE, TYPE_SOLID, &update_PCLN}, {"HSWC", PIXPACK(0x3B1010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", ST_NONE, TYPE_SOLID, &update_HSWC},