summaryrefslogtreecommitdiff
path: root/src/elements/elec.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-11-21 00:48:39 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-21 00:48:39 (GMT)
commit876c861c425ad424ffc5af4bf39b2a3441b50f9a (patch)
tree2140759c599a763e9887bd3a0ee119fbeb37ef33 /src/elements/elec.c
parent8c6e7caaff883f9c7df111df65737547bd280c7a (diff)
downloadpowder-876c861c425ad424ffc5af4bf39b2a3441b50f9a.zip
powder-876c861c425ad424ffc5af4bf39b2a3441b50f9a.tar.gz
Fix LCRY/ELEC infinite loop, BIZR turns photons into electrons, SING explodes with electrons, electrons react with deut.
Diffstat (limited to 'src/elements/elec.c')
-rw-r--r--src/elements/elec.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/elements/elec.c b/src/elements/elec.c
index 014c162..4c3232e 100644
--- a/src/elements/elec.c
+++ b/src/elements/elec.c
@@ -5,6 +5,10 @@ int update_ELEC(UPDATE_FUNC_ARGS) {
float rr, rrr;
parts[i].pavg[0] = x;
parts[i].pavg[1] = y;
+ if(pmap[y][x]==PT_GLOW)
+ {
+ part_change_type(i, x, y, PT_PHOT);
+ }
for (rx=-2; rx<=2; rx++)
for (ry=-2; ry<=2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) {
@@ -39,7 +43,7 @@ int update_ELEC(UPDATE_FUNC_ARGS) {
}
if ((r&0xFF)==PT_LCRY)
{
- parts[r>>8].life = 5+rand()%5;
+ parts[r>>8].tmp2 = 5+rand()%5;
}
if ((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || (r&0xFF)==PT_CBNW)
{
@@ -66,6 +70,15 @@ int update_ELEC(UPDATE_FUNC_ARGS) {
parts[r>>8].life = 0;
parts[r>>8].ctype = 0;
}
+ if ((r&0xFF)==PT_DEUT)
+ {
+ if(parts[r>>8].life < 6000)
+ parts[r>>8].life += 1;
+ parts[r>>8].temp = 0;
+ parts[i].temp = 0;
+ kill_part(i);
+ return 1;
+ }
if (ptypes[r&0xFF].properties & PROP_CONDUCTS)
{
create_part(-1, x+rx, y+ry, PT_SPRK);