From c37f3b1ebac0c5016b2efcea9e2e06f46adbf485 Mon Sep 17 00:00:00 2001 From: savask Date: Wed, 27 Jul 2011 16:38:42 +0700 Subject: [PATCH 01/11] New stick mans collisions code. --- src/elements/stkm.c | 166 +++++++++++--------------------------------- 1 file changed, 40 insertions(+), 126 deletions(-) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index f3b1c3c38..5f92f3579 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -86,97 +86,58 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { playerp[26] = 0; //Go left - r = pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]; - if (((int)(playerp[0])&0x01) == 0x01 && (((r&0xFF)>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) + if (((int)(playerp[0])&0x01) == 0x01) { - if (r>=PT_NUM || (ptypes[r&0xFF].state != ST_LIQUID - && (r&0xFF) != PT_LNTG)) + if (playerp[7]>playerp[15]) { - if (pmap[(int)(playerp[8]-1)][(int)(playerp[7])]) + if (!eval_move(PT_DUST, playerp[7], playerp[8], NULL)) { playerp[21] = -3; - playerp[22] = -2; - playerp[19] = -2; - } - - if (pmap[(int)(playerp[16]-1)][(int)(playerp[15])]) - { - playerp[25] = -3; - playerp[26] = -2; - playerp[23] = -2; + playerp[19] = -1; + playerp[22] = -3; } } else { - if (pmap[(int)(playerp[8]-1)][(int)(playerp[7])]) //It should move another way in liquids + if (!eval_move(PT_DUST, playerp[15], playerp[16], NULL)) { - playerp[21] = -1; - playerp[22] = -1; + playerp[25] = -3; playerp[19] = -1; - } - - if (pmap[(int)(playerp[16]-1)][(int)(playerp[15])]) - { - playerp[25] = -1; - playerp[26] = -1; - playerp[23] = -1; + playerp[26] = -3; } } } //Go right - r = pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]; - if (((int)(playerp[0])&0x02) == 0x02 && (((r&0xFF)>=PT_NUM) || ptypes[r&0xFF].state != ST_GAS)) + if (((int)(playerp[0])&0x02) == 0x02) { - if (r>=PT_NUM || (ptypes[r&0xFF].state != ST_LIQUID - && (r&0xFF) != PT_LNTG)) + if (playerp[7]=PT_NUM || - ptypes[pmap[(int)(playerp[8]-0.5)][(int)(playerp[7])]&0xFF].state != ST_GAS || - (pmap[(int)(playerp[16]-0.5)][(int)(playerp[15])]&0xFF)>=PT_NUM || - ptypes[pmap[(int)(playerp[16]-0.5)][(int)(playerp[15])]&0xFF].state != ST_GAS)) + if (((int)(playerp[0])&0x04) == 0x04 && + (!eval_move(PT_DUST, playerp[7], playerp[8], NULL) || !eval_move(PT_DUST, playerp[15], playerp[16], NULL))) { - if (pmap[(int)(playerp[8]-0.5)][(int)(playerp[7])] || pmap[(int)(playerp[16]-0.5)][(int)(playerp[15])]) - { - parts[i].vy = -5; - playerp[22] -= 1; - playerp[26] -= 1; - } + parts[i].vy = -5; + playerp[22] -= 1; + playerp[26] -= 1; } //Charge detector wall if foot inside @@ -290,78 +251,31 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { playerp[11] += (playerp[11]-parts[i].x)*d; playerp[12] += (playerp[12]-parts[i].y)*d; - //Side collisions checking - for (rx = -3; rx <= 3; rx++) + if (!eval_move(PT_DUST, playerp[7], playerp[8], NULL)) { - r = pmap[(int)(playerp[16]-2)][(int)(playerp[15]+rx)]; - if (r && ((r&0xFF)>=PT_NUM || (ptypes[r&0xFF].state != ST_GAS && ptypes[r&0xFF].state != ST_LIQUID))) - playerp[15] -= rx; - - r = pmap[(int)(playerp[8]-2)][(int)(playerp[7]+rx)]; - if (r && ((r&0xFF)>=PT_NUM || (ptypes[r&0xFF].state != ST_GAS && ptypes[r&0xFF].state != ST_LIQUID))) - playerp[7] -= rx; + playerp[7] = playerp[9]; + playerp[8] = playerp[10]; } - //Collision checks - for (ry = -2-(int)parts[i].vy; ry<=0; ry++) + if (!eval_move(PT_DUST, playerp[15], playerp[16], NULL)) { - r = pmap[(int)(playerp[8]+ry)][(int)(playerp[7]+0.5)]; //This is to make coding more pleasant :-) + playerp[15] = playerp[17]; + playerp[16] = playerp[18]; + } - //For left leg - if (r && (r&0xFF)!=PT_STKM) - { - if ((r&0xFF)1) - parts[i].vx *= 0.5*dt; - } - else - { - if ((r&0xFF)>=PT_NUM || ptypes[r&0xFF].state != ST_GAS) - { - playerp[8] += ry-1; - parts[i].vy -= 0.5*parts[i].vy*dt; - } - } - playerp[9] = playerp[7]; - } - - r = pmap[(int)(playerp[16]+ry)][(int)(playerp[15]+0.5)]; - - //For right leg - if (r && (r&0xFF)!=PT_STKM) - { - if ((r&0xFF)1) - parts[i].vx *= 0.5*dt; - } - else - { - if ((r&0xFF)>=PT_NUM || ptypes[r&0xFF].state != ST_GAS) - { - playerp[16] += ry-1; - parts[i].vy -= 0.5*parts[i].vy*dt; - } - } - playerp[17] = playerp[15]; - } - - //If it falls too fast - if (parts[i].vy>=30) - { - parts[i].y -= (10+ry)*dt; - parts[i].vy = -10*dt; - } + //This makes stick man "pop" from obstacles + if (!eval_move(PT_DUST, playerp[7], playerp[8], NULL)) + { + float t; + t = playerp[7]; playerp[7] = playerp[9]; playerp[9] = t; + t = playerp[8]; playerp[8] = playerp[10]; playerp[10] = t; + } + if (!eval_move(PT_DUST, playerp[15], playerp[16], NULL)) + { + float t; + t = playerp[15]; playerp[15] = playerp[17]; playerp[17] = t; + t = playerp[16]; playerp[16] = playerp[18]; playerp[18] = t; } //Keeping legs distance From fd38838b511b6a730f4f248217c4a47554390049 Mon Sep 17 00:00:00 2001 From: savask Date: Wed, 27 Jul 2011 16:58:22 +0700 Subject: [PATCH 02/11] Added a recoil when stick man is spawning. --- src/elements/stkm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 5f92f3579..4558509d5 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -204,7 +204,10 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { else np = create_part(-1, rx, ry, playerp[2]); if ( (np < NPART) && np>=0 && playerp[2] != PT_PHOT && playerp[2] != SPC_AIR) + { parts[np].vx = parts[np].vx + 5*((((int)playerp[1])&0x02) == 0x02) - 5*(((int)(playerp[1])&0x01) == 0x01); + parts[i].vx -= (ptypes[(int)playerp[2]].weight*parts[np].vx)/1000; + } if ((np < NPART) && np>=0 && playerp[2] == PT_PHOT) { int random = abs(rand()%3-1)*3; From 65c8e27538513bd87dcc89130e87f24aa359bbe1 Mon Sep 17 00:00:00 2001 From: savask Date: Mon, 8 Aug 2011 23:28:16 +0700 Subject: [PATCH 03/11] New walking code (WIP) --- src/elements/stkm.c | 108 +++++++++++++++++++++++++++++++------------- src/powder.c | 2 +- 2 files changed, 78 insertions(+), 32 deletions(-) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 4558509d5..4a706a5f0 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -41,34 +41,59 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { return 1; } - parts[i].vy += -0.7*dt; //Head up! + //Follow gravity + float gvx, gvy; + gvx = gvy = 0.0f; + switch (gravityMode) + { + default: + case 0: + gvy = 1; + break; + case 1: + gvy = gvx = 0.0f; + break; + case 2: + { + float gravd; + gravd = 0.01f - hypotf((parts[i].x - XCNTR), (parts[i].y - YCNTR)); + gvx = ((float)(parts[i].x - XCNTR) / gravd); + gvy = ((float)(parts[i].y - YCNTR) / gravd); + } + } + + gvx += gravx[(int)parts[i].y/CELL][(int)parts[i].x/CELL]; + gvy += gravy[(int)parts[i].y/CELL][(int)parts[i].x/CELL]; + + parts[i].vx -= gvx*dt; //Head up! + parts[i].vy -= gvy*dt; //Verlet integration - pp = 2*playerp[3]-playerp[5]+playerp[19]*dt*dt;; + pp = 2*playerp[3]-playerp[5]+playerp[19]*dt*dt; playerp[5] = playerp[3]; playerp[3] = pp; - pp = 2*playerp[4]-playerp[6]+playerp[20]*dt*dt;; + pp = 2*playerp[4]-playerp[6]+playerp[20]*dt*dt; playerp[6] = playerp[4]; playerp[4] = pp; - pp = 2*playerp[7]-playerp[9]+playerp[21]*dt*dt;; + pp = 2*playerp[7]-playerp[9]+(playerp[21]+gvx)*dt*dt; playerp[9] = playerp[7]; playerp[7] = pp; - pp = 2*playerp[8]-playerp[10]+(playerp[22]+1)*dt*dt;; + pp = 2*playerp[8]-playerp[10]+(playerp[22]+gvy)*dt*dt; playerp[10] = playerp[8]; playerp[8] = pp; - pp = 2*playerp[11]-playerp[13]+playerp[23]*dt*dt;; + pp = 2*playerp[11]-playerp[13]+playerp[23]*dt*dt; playerp[13] = playerp[11]; playerp[11] = pp; - pp = 2*playerp[12]-playerp[14]+playerp[24]*dt*dt;; + pp = 2*playerp[12]-playerp[14]+playerp[24]*dt*dt; playerp[14] = playerp[12]; playerp[12] = pp; - pp = 2*playerp[15]-playerp[17]+playerp[25]*dt*dt;; + pp = 2*playerp[15]-playerp[17]+(playerp[25]+gvx)*dt*dt; playerp[17] = playerp[15]; playerp[15] = pp; - pp = 2*playerp[16]-playerp[18]+(playerp[26]+1)*dt*dt;; + pp = 2*playerp[16]-playerp[18]+(playerp[26]+gvy)*dt*dt; playerp[18] = playerp[16]; playerp[16] = pp; @@ -92,18 +117,18 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { { if (!eval_move(PT_DUST, playerp[7], playerp[8], NULL)) { - playerp[21] = -3; - playerp[19] = -1; - playerp[22] = -3; + playerp[21] = -3*gvy; + playerp[19] = -1*gvy; + playerp[22] = -3*gvy; } } else { if (!eval_move(PT_DUST, playerp[15], playerp[16], NULL)) { - playerp[25] = -3; - playerp[19] = -1; - playerp[26] = -3; + playerp[25] = -3*gvy; + playerp[19] = -1*gvy; + playerp[26] = -3*gvy; } } } @@ -115,18 +140,18 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { { if (!eval_move(PT_DUST, playerp[7], playerp[8], NULL)) { - playerp[21] = 3; - playerp[19] = 1; - playerp[22] = -3; + playerp[21] = 3*gvy; + playerp[19] = 1*gvy; + playerp[22] = -3*gvy; } } else { if (!eval_move(PT_DUST, playerp[15], playerp[16], NULL)) { - playerp[25] = 3; - playerp[19] = 1; - playerp[26] = -3; + playerp[25] = 3*gvy; + playerp[19] = 1*gvy; + playerp[26] = -3*gvy; } } } @@ -135,9 +160,9 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { if (((int)(playerp[0])&0x04) == 0x04 && (!eval_move(PT_DUST, playerp[7], playerp[8], NULL) || !eval_move(PT_DUST, playerp[15], playerp[16], NULL))) { - parts[i].vy = -5; - playerp[22] -= 1; - playerp[26] -= 1; + parts[i].vy -= 4*gvy; + playerp[22] -= gvy; + playerp[26] -= gvy; } //Charge detector wall if foot inside @@ -205,7 +230,8 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { np = create_part(-1, rx, ry, playerp[2]); if ( (np < NPART) && np>=0 && playerp[2] != PT_PHOT && playerp[2] != SPC_AIR) { - parts[np].vx = parts[np].vx + 5*((((int)playerp[1])&0x02) == 0x02) - 5*(((int)(playerp[1])&0x01) == 0x01); + parts[np].vx -= -gvy*(5*((((int)playerp[1])&0x02) == 0x02) - 5*(((int)(playerp[1])&0x01) == 0x01)); + parts[np].vy -= gvx*(5*((((int)playerp[1])&0x02) == 0x02) - 5*(((int)(playerp[1])&0x01) == 0x01)); parts[i].vx -= (ptypes[(int)playerp[2]].weight*parts[np].vx)/1000; } if ((np < NPART) && np>=0 && playerp[2] == PT_PHOT) @@ -282,16 +308,36 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { } //Keeping legs distance - if (pow((playerp[7] - playerp[15]), 2)<16 && pow((playerp[8]-playerp[16]), 2)<1) + if ((pow((playerp[7] - playerp[15]), 2) + pow((playerp[8]-playerp[16]), 2))<16) { - playerp[21] -= 0.2; - playerp[25] += 0.2; + float tvx, tvy; + tvx = -gvy; + tvy = gvx; + + if (tvx || tvy) + { + playerp[21] -= 0.2*tvx/hypot(tvx, tvy); + playerp[22] -= 0.2*tvy/hypot(tvx, tvy); + + playerp[25] += 0.2*tvx/hypot(tvx, tvy); + playerp[26] += 0.2*tvy/hypot(tvx, tvy); + } } - if (pow((playerp[3] - playerp[11]), 2)<16 && pow((playerp[4]-playerp[12]), 2)<1) + if ((pow((playerp[3] - playerp[11]), 2) + pow((playerp[4]-playerp[12]), 2))<16) { - playerp[19] -= 0.2; - playerp[23] += 0.2; + float tvx, tvy; + tvx = -gvy; + tvy = gvx; + + if (tvx || tvy) + { + playerp[19] -= 0.2*tvx/hypot(tvx, tvy); + playerp[20] -= 0.2*tvy/hypot(tvx, tvy); + + playerp[23] += 0.2*tvx/hypot(tvx, tvy); + playerp[24] += 0.2*tvy/hypot(tvx, tvy); + } } //If legs touch something diff --git a/src/powder.c b/src/powder.c index 095a6edf4..595132bfc 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1688,7 +1688,7 @@ void update_particles_i(pixel *vid, int start, int inc) pGravX -= gravx[y/CELL][x/CELL]; pGravY -= gravy[y/CELL][x/CELL]; } - else if(!(ptypes[t].properties & TYPE_SOLID)) + else if(t!=PT_STKM && t!=PT_STKM2 && !(ptypes[t].properties & TYPE_SOLID)) { pGravX += gravx[y/CELL][x/CELL]; pGravY += gravy[y/CELL][x/CELL]; From 15dab3daadab6671771098c8145cb932dee917c2 Mon Sep 17 00:00:00 2001 From: savask Date: Wed, 10 Aug 2011 23:32:10 +0700 Subject: [PATCH 04/11] Imporved walking in a gravity field. --- src/elements/stkm.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 4a706a5f0..28d9269f5 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -110,25 +110,34 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { playerp[25] = 0; playerp[26] = 0; + float gx, gy, dl, dr; + + gx = (player[7] + player[15])/2 - gvy; + gy = (player[8] + player[16])/2 + gvx; + dl = pow(gx - player[7], 2) + pow(gy - player[8], 2); + dr = pow(gx - player[15], 2) + pow(gy - player[16], 2); + //Go left if (((int)(playerp[0])&0x01) == 0x01) { - if (playerp[7]>playerp[15]) + if (dl>dr) { if (!eval_move(PT_DUST, playerp[7], playerp[8], NULL)) { - playerp[21] = -3*gvy; - playerp[19] = -1*gvy; - playerp[22] = -3*gvy; + playerp[21] = -3*gvy-3*gvx; + playerp[22] = 3*gvx-3*gvy; + playerp[19] = -gvy; + playerp[20] = gvx; } } else { if (!eval_move(PT_DUST, playerp[15], playerp[16], NULL)) { - playerp[25] = -3*gvy; - playerp[19] = -1*gvy; - playerp[26] = -3*gvy; + playerp[25] = -3*gvy-3*gvx; + playerp[26] = 3*gvx-3*gvy; + playerp[19] = -gvy; + playerp[20] = gvx; } } } @@ -136,22 +145,24 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { //Go right if (((int)(playerp[0])&0x02) == 0x02) { - if (playerp[7] Date: Thu, 11 Aug 2011 00:19:30 +0700 Subject: [PATCH 05/11] Fixed my mistake in names. --- src/elements/stkm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index 28d9269f5..89bcd0e53 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -112,10 +112,10 @@ int run_stickman(float* playerp, UPDATE_FUNC_ARGS) { float gx, gy, dl, dr; - gx = (player[7] + player[15])/2 - gvy; - gy = (player[8] + player[16])/2 + gvx; - dl = pow(gx - player[7], 2) + pow(gy - player[8], 2); - dr = pow(gx - player[15], 2) + pow(gy - player[16], 2); + gx = (playerp[7] + playerp[15])/2 - gvy; + gy = (playerp[8] + playerp[16])/2 + gvx; + dl = pow(gx - playerp[7], 2) + pow(gy - playerp[8], 2); + dr = pow(gx - playerp[15], 2) + pow(gy - playerp[16], 2); //Go left if (((int)(playerp[0])&0x01) == 0x01) From 86e9a6eeff5c35dc42844502200e1614d1515b71 Mon Sep 17 00:00:00 2001 From: savask Date: Thu, 11 Aug 2011 17:08:43 +0700 Subject: [PATCH 06/11] Fixed a bug where you were able to create multiply stickmans by copying it. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index e403b3da8..ab564eb35 100644 --- a/src/main.c +++ b/src/main.c @@ -714,7 +714,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char j = PT_DUST;//goto corrupt; } gol[x][y]=0; - if (j)// && !(player[27] == 1 && j==PT_STKM)) + if (j && !(player[27] == 1 && j==PT_STKM) && !(player2[27] == 1 && j==PT_STKM2)) //Don't comment this, it's needed { if (pmap[y][x] && (pmap[y][x]>>8) Date: Fri, 12 Aug 2011 11:56:52 -0400 Subject: [PATCH 07/11] Realistic burn temp for O2 and H2 reaction ~~3200 Celcius --- src/elements/O2.c | 2 ++ src/elements/h2.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/elements/O2.c b/src/elements/O2.c index 2584d3ad6..a0087666d 100644 --- a/src/elements/O2.c +++ b/src/elements/O2.c @@ -14,6 +14,8 @@ int update_O2(UPDATE_FUNC_ARGS) if ((r&0xFF)==PT_FIRE) { parts[r>>8].temp+=(rand()/(RAND_MAX/100)); + if(parts[r>>8].tmp&0x01) + parts[r>>8].temp=3473; parts[r>>8].tmp |= 2; } if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) diff --git a/src/elements/h2.c b/src/elements/h2.c index 336f496e2..36c110e91 100644 --- a/src/elements/h2.c +++ b/src/elements/h2.c @@ -19,6 +19,8 @@ int update_H2(UPDATE_FUNC_ARGS) if ((r&0xFF)==PT_FIRE) { parts[r>>8].temp+=(rand()/(RAND_MAX/100)); + if(parts[r>>8].tmp&0x02) + parts[r>>8].temp=3473; parts[r>>8].tmp |= 1; } if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_LAVA) From 8824bcc6095704a2295423775e5dd6213cd4284d Mon Sep 17 00:00:00 2001 From: Bryan Hoyle Date: Fri, 12 Aug 2011 12:08:05 -0400 Subject: [PATCH 08/11] Made wtrv cool down over 1000 C --- src/elements/wtrv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/elements/wtrv.c b/src/elements/wtrv.c index 7a32c9434..cfa6c5da6 100644 --- a/src/elements/wtrv.c +++ b/src/elements/wtrv.c @@ -15,5 +15,7 @@ int update_WTRV(UPDATE_FUNC_ARGS) { parts[i].life = 4; } } + if(parts[i].temp>1273) + parts[i].temp-=parts[i].temp/1000; return 0; } From acebad0744e501214a4f2ae610c410e63e486084 Mon Sep 17 00:00:00 2001 From: Bryan Hoyle Date: Fri, 12 Aug 2011 12:18:41 -0400 Subject: [PATCH 09/11] Made the WTVR coolign only for teh H2/O2 reaction (To keep save compatavbility) --- src/elements/pyro.c | 1 + src/elements/wtrv.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/elements/pyro.c b/src/elements/pyro.c index 985151aca..bd6ab2639 100644 --- a/src/elements/pyro.c +++ b/src/elements/pyro.c @@ -14,6 +14,7 @@ int update_PYRO(UPDATE_FUNC_ARGS) { t = PT_DSTW; part_change_type(i,x,y,t); parts[i].life = 0; + parts[i].ctype = PT_FIRE; } else if (parts[i].temp<625) { diff --git a/src/elements/wtrv.c b/src/elements/wtrv.c index cfa6c5da6..a4facdecf 100644 --- a/src/elements/wtrv.c +++ b/src/elements/wtrv.c @@ -15,7 +15,7 @@ int update_WTRV(UPDATE_FUNC_ARGS) { parts[i].life = 4; } } - if(parts[i].temp>1273) + if(parts[i].temp>1273&&parts[i].ctype==PT_FIRE) parts[i].temp-=parts[i].temp/1000; return 0; } From 89605f3deb967f07f12d964ff62dff5d6f369c0d Mon Sep 17 00:00:00 2001 From: Bryan Hoyle Date: Fri, 12 Aug 2011 12:21:24 -0400 Subject: [PATCH 10/11] More realistic H2/air burn temp --- src/elements/h2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/h2.c b/src/elements/h2.c index 36c110e91..88580a363 100644 --- a/src/elements/h2.c +++ b/src/elements/h2.c @@ -18,7 +18,7 @@ int update_H2(UPDATE_FUNC_ARGS) } if ((r&0xFF)==PT_FIRE) { - parts[r>>8].temp+=(rand()/(RAND_MAX/100)); + parts[r>>8].temp+=(rand()/(RAND_MAX/100))+2000; if(parts[r>>8].tmp&0x02) parts[r>>8].temp=3473; parts[r>>8].tmp |= 1; From ca66525bea67de164603163752aee0212d59df34 Mon Sep 17 00:00:00 2001 From: Bryan Hoyle Date: Fri, 12 Aug 2011 12:25:16 -0400 Subject: [PATCH 11/11] I thought Rand_max was smaller, fixed h2 burn temp down to about 2200 Celcius instead of 9000... --- src/elements/h2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/h2.c b/src/elements/h2.c index 88580a363..04f3d0154 100644 --- a/src/elements/h2.c +++ b/src/elements/h2.c @@ -18,7 +18,7 @@ int update_H2(UPDATE_FUNC_ARGS) } if ((r&0xFF)==PT_FIRE) { - parts[r>>8].temp+=(rand()/(RAND_MAX/100))+2000; + parts[r>>8].temp=2473.15; if(parts[r>>8].tmp&0x02) parts[r>>8].temp=3473; parts[r>>8].tmp |= 1;