summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-12-21 20:23:27 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-12-21 20:23:27 (GMT)
commitfc7f872d8b39667e96e8bd825fe7908755c869fc (patch)
tree9c19d49a829ec175c03f215ad8792931e5d08acb /src/elements
parenta716c59610f4ffe7263715f3aae8e20f44755c9b (diff)
downloadpowder-fc7f872d8b39667e96e8bd825fe7908755c869fc.zip
powder-fc7f872d8b39667e96e8bd825fe7908755c869fc.tar.gz
Fix issue where heat transition would turn TNT to fire, TNT uses tmp for trigger state while Fire uses it for water vapourness.
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/bang.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/elements/bang.c b/src/elements/bang.c
index a35e0fd..2c5c904 100644
--- a/src/elements/bang.c
+++ b/src/elements/bang.c
@@ -4,22 +4,25 @@ int update_BANG(UPDATE_FUNC_ARGS) {
int r, rx, ry, nb;
if(parts[i].tmp==0)
{
- for (rx=-1; rx<2; rx++)
- for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
- {
- 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(parts[i].temp>=673.0f)
+ parts[i].tmp = 1;
+ else
+ for (rx=-1; rx<2; rx++)
+ for (ry=-1; ry<2; ry++)
+ if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
- parts[i].tmp = 1;
+ 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)
+ {
+ parts[i].tmp = 1;
+ }
}
- }
}
else if(parts[i].tmp==1)
@@ -36,6 +39,7 @@ int update_BANG(UPDATE_FUNC_ARGS) {
float otemp = parts[i].temp-275.13f;
//Explode!!
pv[y/CELL][x/CELL] += 0.5f;
+ parts[i].tmp = 0;
if(!(rand()%3))
{
if(!(rand()%2))