diff options
Diffstat (limited to 'src/simulation/elements/PLNT.cpp')
| -rw-r--r-- | src/simulation/elements/PLNT.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp index dd8928c..4a8a591 100644 --- a/src/simulation/elements/PLNT.cpp +++ b/src/simulation/elements/PLNT.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_PLNT PT_PLNT 20 Element_PLNT::Element_PLNT() { - Identifier = "DEFAULT_PT_PLNT"; - Name = "PLNT"; - Colour = PIXPACK(0x0CAC00); - MenuVisible = 1; - MenuSection = SC_SOLIDS; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.95f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 20; - Explosive = 0; - Meltable = 0; - Hardness = 10; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 65; - Description = "Plant, drinks water and grows."; - - State = ST_SOLID; - Properties = TYPE_SOLID|PROP_NEUTPENETRATE|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 573.0f; - HighTemperatureTransition = PT_FIRE; - - Update = &Element_PLNT::update; - Graphics = &Element_PLNT::graphics; + Identifier = "DEFAULT_PT_PLNT"; + Name = "PLNT"; + Colour = PIXPACK(0x0CAC00); + MenuVisible = 1; + MenuSection = SC_SOLIDS; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.95f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 20; + Explosive = 0; + Meltable = 0; + Hardness = 10; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 65; + Description = "Plant, drinks water and grows."; + + State = ST_SOLID; + Properties = TYPE_SOLID|PROP_NEUTPENETRATE|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 573.0f; + HighTemperatureTransition = PT_FIRE; + + Update = &Element_PLNT::update; + Graphics = &Element_PLNT::graphics; } //#TPT-Directive ElementHeader Element_PLNT static int update(UPDATE_FUNC_ARGS) @@ -52,7 +52,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS) int r, rx, ry, 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]; switch (r&0xFF) @@ -103,7 +103,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS) { 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) |
