summaryrefslogtreecommitdiff
path: root/src/simulation/elements
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-03-04 00:07:15 (GMT)
committer jacob1 <jfu614@gmail.com>2013-03-04 00:07:15 (GMT)
commitf951e5cda9ad51b590767790519091af8d4a6ee1 (patch)
tree6e99485f653a0bbb87c081aae9467eff3a7d7f28 /src/simulation/elements
parent8b83ae9f95210ab3d540c985f82bc344786c3b85 (diff)
downloadpowder-f951e5cda9ad51b590767790519091af8d4a6ee1.zip
powder-f951e5cda9ad51b590767790519091af8d4a6ee1.tar.gz
fix LIFE
Diffstat (limited to 'src/simulation/elements')
-rw-r--r--src/simulation/elements/LIFE.cpp9
-rw-r--r--src/simulation/elements/PSTN.cpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp
index 4207931..a664d2f 100644
--- a/src/simulation/elements/LIFE.cpp
+++ b/src/simulation/elements/LIFE.cpp
@@ -46,7 +46,7 @@ Element_LIFE::Element_LIFE()
HighTemperature = ITH;
HighTemperatureTransition = NT;
- Update = NULL;
+ Update = &Element_LIFE::update;
Graphics = &Element_LIFE::graphics;
if(!Element_GOL_colourInit)
@@ -64,6 +64,13 @@ Element_LIFE::Element_LIFE()
}
}
+//#TPT-Directive ElementHeader Element_LIFE static int update(UPDATE_FUNC_ARGS)
+int Element_LIFE::update(UPDATE_FUNC_ARGS)
+{
+ if (parts[i].tmp <= 0)
+ sim->kill_part(i);
+ return 0;
+}
//#TPT-Directive ElementHeader Element_LIFE static int graphics(GRAPHICS_FUNC_ARGS)
int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp
index abd983a..0c350b1 100644
--- a/src/simulation/elements/PSTN.cpp
+++ b/src/simulation/elements/PSTN.cpp
@@ -49,8 +49,6 @@ Element_PSTN::Element_PSTN()
//#TPT-Directive ElementHeader Element_PSTN static int tempParts[128];
int Element_PSTN::tempParts[128];
-//#TPT-Directive ElementHeader Element_PSTN static int tempPartAmount[128];
-int Element_PSTN::tempPartAmount[128];
#define PISTON_INACTIVE 0x00
#define PISTON_RETRACT 0x01