From a716c59610f4ffe7263715f3aae8e20f44755c9b Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 21 Dec 2011 17:39:53 +0000 Subject: [PATCH] Added some heat to TNT and IGNC --- src/elements/bang.c | 21 ++++++++++----------- src/elements/ignt.c | 1 + src/powder.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/elements/bang.c b/src/elements/bang.c index 54fea4fe3..a35e0fd9f 100644 --- a/src/elements/bang.c +++ b/src/elements/bang.c @@ -1,7 +1,7 @@ #include int update_BANG(UPDATE_FUNC_ARGS) { - int r, rx, ry; + int r, rx, ry, nb; if(parts[i].tmp==0) { for (rx=-1; rx<2; rx++) @@ -33,33 +33,32 @@ int update_BANG(UPDATE_FUNC_ARGS) { } else if(parts[i].tmp>=3) { + float otemp = parts[i].temp-275.13f; //Explode!! pv[y/CELL][x/CELL] += 0.5f; if(!(rand()%3)) { if(!(rand()%2)) { - parts[i].tmp = 0; create_part(i, x, y, PT_FIRE); + parts[i].temp = (MAX_TEMP/4)+otemp; } else { - parts[i].tmp = 0; create_part(i, x, y, PT_SMKE); + parts[i].temp = (MAX_TEMP/4)+otemp; } } else { if(!(rand()%15)) { - int nb = create_part(i, x, y, PT_BOMB); - if (nb!=-1) { - parts[nb].tmp = 1; - parts[nb].life = 50; - //parts[nb].temp = MAX_TEMP; - parts[nb].vx = rand()%20-10; - parts[nb].vy = rand()%20-10; - } + create_part(i, x, y, PT_BOMB); + parts[i].tmp = 1; + parts[i].life = 50; + parts[i].temp = (MAX_TEMP/3)+otemp; + parts[i].vx = rand()%20-10; + parts[i].vy = rand()%20-10; } else { diff --git a/src/elements/ignt.c b/src/elements/ignt.c index 817e5f976..c11fccf95 100644 --- a/src/elements/ignt.c +++ b/src/elements/ignt.c @@ -31,6 +31,7 @@ int update_IGNT(UPDATE_FUNC_ARGS) { parts[nb].life = 30; parts[nb].vx = rand()%20-10; parts[nb].vy = rand()%20-10; + parts[nb].temp = 400.0f+parts[i].temp-273.15; } } else diff --git a/src/powder.c b/src/powder.c index 9e6c0676a..4acd33404 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1092,7 +1092,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a colb = colb>255 ? 255 : (colb<0 ? 0 : colb); parts[i].dcolour = 0xFF000000 | (colr<<16) | (colg<<8) | colb; } - + return i; }