summaryrefslogtreecommitdiff
path: root/src/simulation/elements/CLNE.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/CLNE.cpp')
-rw-r--r--src/simulation/elements/CLNE.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/simulation/elements/CLNE.cpp b/src/simulation/elements/CLNE.cpp
index 56839f0..939feb0 100644
--- a/src/simulation/elements/CLNE.cpp
+++ b/src/simulation/elements/CLNE.cpp
@@ -67,17 +67,25 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS)
(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;
}
}
}
else {
if (parts[i].ctype==PT_LIFE) sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, 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;
}
-Element_CLNE::~Element_CLNE() {} \ No newline at end of file
+Element_CLNE::~Element_CLNE() {}