summaryrefslogtreecommitdiff
path: root/src/simulation/elements/PBCN.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/PBCN.cpp')
-rw-r--r--src/simulation/elements/PBCN.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/simulation/elements/PBCN.cpp b/src/simulation/elements/PBCN.cpp
index 270bfb5..af37a59 100644
--- a/src/simulation/elements/PBCN.cpp
+++ b/src/simulation/elements/PBCN.cpp
@@ -82,7 +82,7 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS)
(r&0xFF)!=PT_PBCN && (r&0xFF)<PT_NUM)
{
parts[i].ctype = r&0xFF;
- if ((r&0xFF)==PT_LIFE)
+ if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA)
parts[i].tmp = parts[r>>8].ctype;
}
}
@@ -135,8 +135,15 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS)
sim->create_part(-1, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8));
}
}
- } else {
- sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
+ }
+ else
+ {
+ int np = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
+ if (np>=0)
+ {
+ if (parts[i].ctype==PT_LAVA && parts[i].tmp>0 && parts[i].tmp<PT_NUM && sim->elements[parts[i].tmp].HighTemperatureTransition==PT_LAVA)
+ parts[np].ctype = parts[i].tmp;
+ }
}
}
return 0;
@@ -154,4 +161,4 @@ int Element_PBCN::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_PBCN::~Element_PBCN() {} \ No newline at end of file
+Element_PBCN::~Element_PBCN() {}