summaryrefslogtreecommitdiff
path: root/src/simulation/elements/SPRK.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/SPRK.cpp')
-rw-r--r--src/simulation/elements/SPRK.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp
index 3939bd8..8122385 100644
--- a/src/simulation/elements/SPRK.cpp
+++ b/src/simulation/elements/SPRK.cpp
@@ -2,48 +2,48 @@
//#TPT-Directive ElementClass Element_SPRK PT_SPRK 15
Element_SPRK::Element_SPRK()
{
- Identifier = "DEFAULT_PT_SPRK";
- Name = "SPRK";
- Colour = PIXPACK(0xFFFF80);
- MenuVisible = 1;
- MenuSection = SC_ELEC;
- Enabled = 1;
-
- Advection = 0.0f;
- AirDrag = 0.00f * CFDS;
- AirLoss = 0.90f;
- Loss = 0.00f;
- Collision = 0.0f;
- Gravity = 0.0f;
- Diffusion = 0.00f;
- HotAir = 0.001f * CFDS;
- Falldown = 0;
-
- Flammable = 0;
- Explosive = 0;
- Meltable = 0;
- Hardness = 1;
-
- Weight = 100;
-
- Temperature = R_TEMP+0.0f +273.15f;
- HeatConduct = 251;
- Description = "Electricity. Conducted by metal and water.";
-
- State = ST_SOLID;
- Properties = TYPE_SOLID|PROP_LIFE_DEC;
-
- LowPressure = IPL;
- LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
-
- Update = &Element_SPRK::update;
- Graphics = &Element_SPRK::graphics;
+ Identifier = "DEFAULT_PT_SPRK";
+ Name = "SPRK";
+ Colour = PIXPACK(0xFFFF80);
+ MenuVisible = 1;
+ MenuSection = SC_ELEC;
+ Enabled = 1;
+
+ Advection = 0.0f;
+ AirDrag = 0.00f * CFDS;
+ AirLoss = 0.90f;
+ Loss = 0.00f;
+ Collision = 0.0f;
+ Gravity = 0.0f;
+ Diffusion = 0.00f;
+ HotAir = 0.001f * CFDS;
+ Falldown = 0;
+
+ Flammable = 0;
+ Explosive = 0;
+ Meltable = 0;
+ Hardness = 1;
+
+ Weight = 100;
+
+ Temperature = R_TEMP+0.0f +273.15f;
+ HeatConduct = 251;
+ Description = "Electricity. Conducted by metal and water.";
+
+ State = ST_SOLID;
+ Properties = TYPE_SOLID|PROP_LIFE_DEC;
+
+ LowPressure = IPL;
+ LowPressureTransition = NT;
+ HighPressure = IPH;
+ HighPressureTransition = NT;
+ LowTemperature = ITL;
+ LowTemperatureTransition = NT;
+ HighTemperature = ITH;
+ HighTemperatureTransition = NT;
+
+ Update = &Element_SPRK::update;
+ Graphics = &Element_SPRK::graphics;
}
//#TPT-Directive ElementHeader Element_SPRK static int update(UPDATE_FUNC_ARGS)
@@ -112,7 +112,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
parts[i].tmp=300;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (r)
@@ -143,7 +143,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
case PT_IRON:
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -163,7 +163,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)