diff options
Diffstat (limited to 'src/simulation/elements/ACID.cpp')
| -rw-r--r-- | src/simulation/elements/ACID.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/simulation/elements/ACID.cpp b/src/simulation/elements/ACID.cpp index 6501ba0..e078551 100644 --- a/src/simulation/elements/ACID.cpp +++ b/src/simulation/elements/ACID.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_ACID PT_ACID 21 Element_ACID::Element_ACID() { - Identifier = "DEFAULT_PT_ACID"; - Name = "ACID"; - Colour = PIXPACK(0xED55FF); - MenuVisible = 1; - MenuSection = SC_LIQUID; - Enabled = 1; - - Advection = 0.6f; - AirDrag = 0.01f * CFDS; - AirLoss = 0.98f; - Loss = 0.95f; - Collision = 0.0f; - Gravity = 0.1f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 2; - - Flammable = 40; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 10; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 34; - Description = "Dissolves almost everything."; - - State = ST_LIQUID; - Properties = TYPE_LIQUID|PROP_DEADLY; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_ACID::update; - Graphics = &Element_ACID::graphics; + Identifier = "DEFAULT_PT_ACID"; + Name = "ACID"; + Colour = PIXPACK(0xED55FF); + MenuVisible = 1; + MenuSection = SC_LIQUID; + Enabled = 1; + + Advection = 0.6f; + AirDrag = 0.01f * CFDS; + AirLoss = 0.98f; + Loss = 0.95f; + Collision = 0.0f; + Gravity = 0.1f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 2; + + Flammable = 40; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 10; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 34; + Description = "Dissolves almost everything."; + + State = ST_LIQUID; + Properties = TYPE_LIQUID|PROP_DEADLY; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_ACID::update; + Graphics = &Element_ACID::graphics; } //#TPT-Directive ElementHeader Element_ACID static int update(UPDATE_FUNC_ARGS) @@ -52,7 +52,7 @@ int Element_ACID::update(UPDATE_FUNC_ARGS) int r, rx, ry, trade, np; 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) @@ -99,7 +99,7 @@ int Element_ACID::update(UPDATE_FUNC_ARGS) { rx = rand()%5-2; ry = rand()%5-2; - 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) |
