summaryrefslogtreecommitdiff
path: root/src/simulation/elements/BANG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/BANG.cpp')
-rw-r--r--src/simulation/elements/BANG.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/simulation/elements/BANG.cpp b/src/simulation/elements/BANG.cpp
index 8922e0e..9d9bfbb 100644
--- a/src/simulation/elements/BANG.cpp
+++ b/src/simulation/elements/BANG.cpp
@@ -62,11 +62,7 @@ int Element_BANG::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM)
- {
- parts[i].tmp = 1;
- }
- else if ((r&0xFF)==PT_SPRK || (r&0xFF)==PT_LIGH)
+ if ((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_SPRK || (r&0xFF)==PT_LIGH)
{
parts[i].tmp = 1;
}
@@ -86,9 +82,9 @@ int Element_BANG::update(UPDATE_FUNC_ARGS)
{
parts[i].tmp = 3;
}
- else if(parts[i].tmp>=3)
+ else
{
- float otemp = parts[i].temp-275.13f;
+ float otemp = parts[i].temp-273.15f;
//Explode!!
sim->pv[y/CELL][x/CELL] += 0.5f;
parts[i].tmp = 0;
@@ -97,14 +93,13 @@ int Element_BANG::update(UPDATE_FUNC_ARGS)
if(!(rand()%2))
{
sim->create_part(i, x, y, PT_FIRE);
- parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
}
else
{
sim->create_part(i, x, y, PT_SMKE);
parts[i].life = rand()%50+500;
- parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
}
+ parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP);
}
else
{