summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-03-16 17:23:19 (GMT)
committer jacob1 <jfu614@gmail.com>2013-03-16 17:23:19 (GMT)
commit3a738846a3e0c59ed02805f11f93678ae42a946e (patch)
tree72cf0fc51fbde58f3d7e6bb1601572a4f20236c0 /src/simulation
parentd76650f7e6983bb11e6217661b143f2efe3791f6 (diff)
downloadpowder-3a738846a3e0c59ed02805f11f93678ae42a946e.zip
powder-3a738846a3e0c59ed02805f11f93678ae42a946e.tar.gz
add identifier constants based on the display name to the lua api
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/Simulation.cpp6
-rw-r--r--src/simulation/elements/ANAR.cpp4
-rw-r--r--src/simulation/elements/C5.cpp4
-rw-r--r--src/simulation/elements/CFLM.cpp (renamed from src/simulation/elements/HFLM.cpp)12
4 files changed, 13 insertions, 13 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index f037252..d59ac51 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -3016,7 +3016,7 @@ int Simulation::create_part(int p, int x, int y, int tv)
case PT_PLSM:
parts[i].life = rand()%150+50;
break;
- case PT_HFLM:
+ case PT_CFLM:
parts[i].life = rand()%150+50;
break;
case PT_LAVA:
@@ -3678,7 +3678,7 @@ void Simulation::update_particles_i(int start, int inc)
(bmap[y/CELL][x/CELL]==WL_DESTROYALL) ||
(bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && elements[t].Falldown!=2) ||
(bmap[y/CELL][x/CELL]==WL_ALLOWSOLID && elements[t].Falldown!=1) ||
- (bmap[y/CELL][x/CELL]==WL_ALLOWGAS && !(elements[t].Properties&TYPE_GAS)) || //&& elements[t].Falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE && parts[i].type!=PT_HFLM) ||
+ (bmap[y/CELL][x/CELL]==WL_ALLOWGAS && !(elements[t].Properties&TYPE_GAS)) || //&& elements[t].Falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE && parts[i].type!=PT_CFLM) ||
(bmap[y/CELL][x/CELL]==WL_ALLOWENERGY && !(elements[t].Properties&TYPE_ENERGY)) ||
(bmap[y/CELL][x/CELL]==WL_DETECT && (t==PT_METL || t==PT_SPRK)) ||
(bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM) && (t!=PT_STKM2) && (t!=PT_FIGH)))
@@ -4038,7 +4038,7 @@ void Simulation::update_particles_i(int start, int inc)
if (elements[t].State==ST_GAS&&elements[parts[i].type].State!=ST_GAS)
pv[y/CELL][x/CELL] += 0.50f;
part_change_type(i,x,y,t);
- if (t==PT_FIRE||t==PT_PLSM||t==PT_HFLM)
+ if (t==PT_FIRE||t==PT_PLSM||t==PT_CFLM)
parts[i].life = rand()%50+120;
if (t==PT_LAVA) {
if (parts[i].ctype==PT_BRMT) parts[i].ctype = PT_BMTL;
diff --git a/src/simulation/elements/ANAR.cpp b/src/simulation/elements/ANAR.cpp
index fa9130e..16d619d 100644
--- a/src/simulation/elements/ANAR.cpp
+++ b/src/simulation/elements/ANAR.cpp
@@ -60,9 +60,9 @@ int Element_ANAR::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if ((r&0xFF)==PT_HFLM && !(rand()%7))
+ if ((r&0xFF)==PT_CFLM && !(rand()%7))
{
- sim->part_change_type(i,x,y,PT_HFLM);
+ sim->part_change_type(i,x,y,PT_CFLM);
parts[i].life = rand()%150+50;
parts[r>>8].temp = parts[i].temp = 0;
sim->pv[y/CELL][x/CELL] -= 0.5;
diff --git a/src/simulation/elements/C5.cpp b/src/simulation/elements/C5.cpp
index 0141991..98d9bf0 100644
--- a/src/simulation/elements/C5.cpp
+++ b/src/simulation/elements/C5.cpp
@@ -57,11 +57,11 @@ int Element_C5::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if (((r&0xFF)!=PT_C5 && parts[r>>8].temp<100 && sim->elements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10)) || (r&0xFF)==PT_HFLM)
+ if (((r&0xFF)!=PT_C5 && parts[r>>8].temp<100 && sim->elements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10)) || (r&0xFF)==PT_CFLM)
{
if (!(rand()%6))
{
- sim->part_change_type(i,x,y,PT_HFLM);
+ sim->part_change_type(i,x,y,PT_CFLM);
parts[r>>8].temp = parts[i].temp = 0;
parts[i].life = rand()%150+50;
sim->pv[y/CELL][x/CELL] += 1.5;
diff --git a/src/simulation/elements/HFLM.cpp b/src/simulation/elements/CFLM.cpp
index 1c39a2c..d19f9f0 100644
--- a/src/simulation/elements/HFLM.cpp
+++ b/src/simulation/elements/CFLM.cpp
@@ -4,8 +4,8 @@ extern "C"
#include "hmap.h"
}
-//#TPT-Directive ElementClass Element_HFLM PT_HFLM 68
-Element_HFLM::Element_HFLM()
+//#TPT-Directive ElementClass Element_CFLM PT_CFLM 68
+Element_CFLM::Element_CFLM()
{
Identifier = "DEFAULT_PT_HFLM";
Name = "CFLM";
@@ -48,11 +48,11 @@ Element_HFLM::Element_HFLM()
HighTemperatureTransition = NT;
Update = NULL;
- Graphics = &Element_HFLM::graphics;
+ Graphics = &Element_CFLM::graphics;
}
-//#TPT-Directive ElementHeader Element_HFLM static int graphics(GRAPHICS_FUNC_ARGS)
-int Element_HFLM::graphics(GRAPHICS_FUNC_ARGS)
+//#TPT-Directive ElementHeader Element_CFLM static int graphics(GRAPHICS_FUNC_ARGS)
+int Element_CFLM::graphics(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)((int)(cpart->life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
@@ -72,4 +72,4 @@ int Element_HFLM::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_HFLM::~Element_HFLM() {} \ No newline at end of file
+Element_CFLM::~Element_CFLM() {} \ No newline at end of file