diff --git a/src/SimulationConfig.h b/src/SimulationConfig.h index 1fd9aef83..f98f29be6 100644 --- a/src/SimulationConfig.h +++ b/src/SimulationConfig.h @@ -61,3 +61,5 @@ constexpr float GLASS_IOR = 1.9f; constexpr float GLASS_DISP = 0.07f; constexpr float R_TEMP = 22; + +constexpr bool LATENTHEAT = false; diff --git a/src/gui/game/IntroText.h b/src/gui/game/IntroText.h index ba094c0f0..36f66b9dc 100644 --- a/src/gui/game/IntroText.h +++ b/src/gui/game/IntroText.h @@ -1,5 +1,6 @@ #pragma once #include "Config.h" +#include "SimulationConfig.h" #include "common/String.h" inline ByteString VersionInfo() @@ -23,9 +24,10 @@ inline ByteString VersionInfo() { sb << " LUACONSOLE"; } -#ifdef REALISTIC - sb << " REALISTIC"; -#endif + if constexpr (LATENTHEAT) + { + sb << " LATENTHEAT"; + } if constexpr (NOHTTP) { sb << " NOHTTP"; diff --git a/src/lua/LegacyLuaAPI.cpp b/src/lua/LegacyLuaAPI.cpp index 93dd81006..06ade0ef2 100644 --- a/src/lua/LegacyLuaAPI.cpp +++ b/src/lua/LegacyLuaAPI.cpp @@ -26,12 +26,15 @@ void initLegacyProps() std::vector properties = Element::GetProperties(); for (auto prop : properties) { + // TODO: move aliases to the property table in Element.cpp? if (prop.Name == "MenuVisible") legacyPropNames.insert(std::pair("menu", prop)); else if (prop.Name == "PhotonReflectWavelengths") continue; else if (prop.Name == "CarriesTypeIn") continue; + else if (prop.Name == "LatentHeat") + continue; else if (prop.Name == "Temperature") legacyPropNames.insert(std::pair("heat", prop)); else if (prop.Name == "HeatConduct") diff --git a/src/simulation/Element.cpp b/src/simulation/Element.cpp index fb5d67faa..ccf217cd9 100644 --- a/src/simulation/Element.cpp +++ b/src/simulation/Element.cpp @@ -29,6 +29,7 @@ Element::Element(): Weight(50), HeatConduct(128), + LatentHeat(0), Description("No description"), Properties(TYPE_SOLID), @@ -80,6 +81,7 @@ std::vector const &Element::GetProperties() { "Weight", StructProperty::Integer, offsetof(Element, Weight ) }, { "Temperature", StructProperty::Float, offsetof(Element, DefaultProperties.temp ) }, { "HeatConduct", StructProperty::UChar, offsetof(Element, HeatConduct ) }, + { "LatentHeat", StructProperty::UInteger, offsetof(Element, LatentHeat ) }, { "Description", StructProperty::String, offsetof(Element, Description ) }, { "State", StructProperty::Removed, 0 }, { "Properties", StructProperty::Integer, offsetof(Element, Properties ) }, diff --git a/src/simulation/Element.h b/src/simulation/Element.h index 8610273bd..791984737 100644 --- a/src/simulation/Element.h +++ b/src/simulation/Element.h @@ -38,6 +38,7 @@ public: unsigned int PhotonReflectWavelengths; int Weight; unsigned char HeatConduct; + unsigned int LatentHeat; String Description; unsigned int Properties; unsigned int CarriesTypeIn; diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index a2fa78680..7416bb684 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2376,14 +2376,17 @@ void Simulation::UpdateParticles(int start, int end) if (elements[t].Diffusion)//the random diffusion that gasses have { -#ifdef REALISTIC - //The magic number controls diffusion speed - parts[i].vx += 0.05*sqrtf(parts[i].temp)*elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); - parts[i].vy += 0.05*sqrtf(parts[i].temp)*elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); -#else - parts[i].vx += elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); - parts[i].vy += elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); -#endif + if constexpr (LATENTHEAT) + { + //The magic number controls diffusion speed + parts[i].vx += 0.05*sqrtf(parts[i].temp)*elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); + parts[i].vy += 0.05*sqrtf(parts[i].temp)*elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); + } + else + { + parts[i].vx += elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); + parts[i].vy += elements[t].Diffusion*(2.0f*rng.uniform01()-1.0f); + } } auto transitionOccurred = false; @@ -2434,35 +2437,41 @@ void Simulation::UpdateParticles(int start, int end) } //heat transfer code -#ifdef REALISTIC - if (t&&(t!=PT_HSWC||parts[i].life==10)&&(elements[t].HeatConduct*gel_scale)) -#else auto h_count = 0; - if (t && (t!=PT_HSWC||parts[i].life==10) && rng.chance(int(elements[t].HeatConduct*gel_scale), 250)) -#endif + bool cond; + if constexpr (LATENTHEAT) + { + cond = t && (t!=PT_HSWC||parts[i].life==10) && elements[t].HeatConduct*gel_scale > 0; + } + else + { + cond = t && (t!=PT_HSWC||parts[i].life==10) && rng.chance(int(elements[t].HeatConduct*gel_scale), 250); + } + if (cond) { if (aheat_enable && !(elements[t].Properties&PROP_NOAMBHEAT)) { -#ifdef REALISTIC - auto c_heat = parts[i].temp*96.645/elements[t].HeatConduct*gel_scale*fabs(elements[t].Weight) + hv[y/CELL][x/CELL]*100*(pv[y/CELL][x/CELL]-MIN_PRESSURE)/(MAX_PRESSURE-MIN_PRESSURE)*2; - float c_Cm = 96.645/elements[t].HeatConduct*gel_scale*fabs(elements[t].Weight) + 100*(pv[y/CELL][x/CELL]-MIN_PRESSURE)/(MAX_PRESSURE-MIN_PRESSURE)*2; - auto pt = c_heat/c_Cm; - pt = restrict_flt(pt, -MAX_TEMP+MIN_TEMP, MAX_TEMP-MIN_TEMP); - parts[i].temp = pt; - //Pressure increase from heat (temporary) - pv[y/CELL][x/CELL] += (pt-hv[y/CELL][x/CELL])*0.004; - hv[y/CELL][x/CELL] = pt; -#else - auto c_heat = (hv[y/CELL][x/CELL]-parts[i].temp)*0.04; - c_heat = restrict_flt(c_heat, -MAX_TEMP+MIN_TEMP, MAX_TEMP-MIN_TEMP); - parts[i].temp += c_heat; - hv[y/CELL][x/CELL] -= c_heat; -#endif + if constexpr (LATENTHEAT) + { + auto c_heat = parts[i].temp*96.645/elements[t].HeatConduct*gel_scale*std::fabs(elements[t].Weight) + hv[y/CELL][x/CELL]*100*(pv[y/CELL][x/CELL]-MIN_PRESSURE)/(MAX_PRESSURE-MIN_PRESSURE)*2; + float c_Cm = 96.645/elements[t].HeatConduct*gel_scale*std::fabs(elements[t].Weight) + 100*(pv[y/CELL][x/CELL]-MIN_PRESSURE)/(MAX_PRESSURE-MIN_PRESSURE)*2; + auto pt = c_heat/c_Cm; + pt = restrict_flt(pt, -MAX_TEMP+MIN_TEMP, MAX_TEMP-MIN_TEMP); + parts[i].temp = pt; + //Pressure increase from heat (temporary) + pv[y/CELL][x/CELL] += (pt-hv[y/CELL][x/CELL])*0.004; + hv[y/CELL][x/CELL] = pt; + } + else + { + auto c_heat = (hv[y/CELL][x/CELL]-parts[i].temp)*0.04; + c_heat = restrict_flt(c_heat, -MAX_TEMP+MIN_TEMP, MAX_TEMP-MIN_TEMP); + parts[i].temp += c_heat; + hv[y/CELL][x/CELL] -= c_heat; + } } auto c_heat = 0.0f; -#ifdef REALISTIC float c_Cm = 0.0f; -#endif int surround_hconduct[8]; for (auto j=0; j<8; j++) { @@ -2480,41 +2489,47 @@ void Simulation::UpdateParticles(int start, int end) && (t!=PT_FILT || rt!=PT_HSWC || parts[ID(r)].tmp != 1)) { surround_hconduct[j] = ID(r); -#ifdef REALISTIC - if (rt==PT_GEL) - gel_scale = parts[ID(r)].tmp*2.55f; - else gel_scale = 1.0f; + if constexpr (LATENTHEAT) + { + if (rt==PT_GEL) + gel_scale = parts[ID(r)].tmp*2.55f; + else gel_scale = 1.0f; - c_heat += parts[ID(r)].temp*96.645/elements[rt].HeatConduct*gel_scale*fabs(elements[rt].Weight); - c_Cm += 96.645/elements[rt].HeatConduct*gel_scale*fabs(elements[rt].Weight); -#else - c_heat += parts[ID(r)].temp; -#endif + c_heat += parts[ID(r)].temp*96.645/elements[rt].HeatConduct*gel_scale*std::fabs(elements[rt].Weight); + c_Cm += 96.645/elements[rt].HeatConduct*gel_scale*std::fabs(elements[rt].Weight); + } + else + { + c_heat += parts[ID(r)].temp; + } h_count++; } } float pt = R_TEMP; -#ifdef REALISTIC - if (t==PT_GEL) - gel_scale = parts[i].tmp*2.55f; - else gel_scale = 1.0f; - - if (t == PT_PHOT) - pt = (c_heat+parts[i].temp*96.645)/(c_Cm+96.645); - else - pt = (c_heat+parts[i].temp*96.645/elements[t].HeatConduct*gel_scale*fabs(elements[t].Weight))/(c_Cm+96.645/elements[t].HeatConduct*gel_scale*fabs(elements[t].Weight)); - - c_heat += parts[i].temp*96.645/elements[t].HeatConduct*gel_scale*fabs(elements[t].Weight); - c_Cm += 96.645/elements[t].HeatConduct*gel_scale*fabs(elements[t].Weight); - parts[i].temp = restrict_flt(pt, MIN_TEMP, MAX_TEMP); -#else - pt = (c_heat+parts[i].temp)/(h_count+1); - pt = parts[i].temp = restrict_flt(pt, MIN_TEMP, MAX_TEMP); - for (auto j=0; j<8; j++) + if constexpr (LATENTHEAT) { - parts[surround_hconduct[j]].temp = pt; + if (t==PT_GEL) + gel_scale = parts[i].tmp*2.55f; + else gel_scale = 1.0f; + + if (t == PT_PHOT) + pt = (c_heat+parts[i].temp*96.645)/(c_Cm+96.645); + else + pt = (c_heat+parts[i].temp*96.645/elements[t].HeatConduct*gel_scale*std::fabs(elements[t].Weight))/(c_Cm+96.645/elements[t].HeatConduct*gel_scale*std::fabs(elements[t].Weight)); + + c_heat += parts[i].temp*96.645/elements[t].HeatConduct*gel_scale*std::fabs(elements[t].Weight); + c_Cm += 96.645/elements[t].HeatConduct*gel_scale*std::fabs(elements[t].Weight); + parts[i].temp = restrict_flt(pt, MIN_TEMP, MAX_TEMP); + } + else + { + pt = (c_heat+parts[i].temp)/(h_count+1); + pt = parts[i].temp = restrict_flt(pt, MIN_TEMP, MAX_TEMP); + for (auto j=0; j<8; j++) + { + parts[surround_hconduct[j]].temp = pt; + } } -#endif auto ctemph = pt; auto ctempl = pt; @@ -2534,25 +2549,27 @@ void Simulation::UpdateParticles(int start, int end) if (elements[t].HighTemperatureTransition>-1 && ctemph>=elements[t].HighTemperature) { // particle type change due to high temperature -#ifdef REALISTIC float dbt = ctempl - pt; if (elements[t].HighTemperatureTransition != PT_NUM) { - if (platent[t] <= (c_heat - (elements[t].HighTemperature - dbt)*c_Cm)) + if constexpr (LATENTHEAT) { - pt = (c_heat - platent[t])/c_Cm; - t = elements[t].HighTemperatureTransition; + if (elements[t].LatentHeat <= (c_heat - (elements[t].HighTemperature - dbt)*c_Cm)) + { + pt = (c_heat - elements[t].LatentHeat)/c_Cm; + t = elements[t].HighTemperatureTransition; + } + else + { + parts[i].temp = restrict_flt(elements[t].HighTemperature - dbt, MIN_TEMP, MAX_TEMP); + s = 0; + } } else { - parts[i].temp = restrict_flt(elements[t].HighTemperature - dbt, MIN_TEMP, MAX_TEMP); - s = 0; + t = elements[t].HighTemperatureTransition; } } -#else - if (elements[t].HighTemperatureTransition != PT_NUM) - t = elements[t].HighTemperatureTransition; -#endif else if (t == PT_ICEI || t == PT_SNOW) { if (parts[i].ctype > 0 && parts[i].ctype < PT_NUM && parts[i].ctype != t) @@ -2567,25 +2584,28 @@ void Simulation::UpdateParticles(int start, int end) if (s) { -#ifdef REALISTIC - //One ice table value for all it's kinds - if (platent[t] <= (c_heat - (elements[parts[i].ctype].LowTemperature - dbt)*c_Cm)) + if constexpr (LATENTHEAT) + { + //One ice table value for all it's kinds + if (elements[t].LatentHeat <= (c_heat - (elements[parts[i].ctype].LowTemperature - dbt)*c_Cm)) + { + pt = (c_heat - elements[t].LatentHeat)/c_Cm; + t = parts[i].ctype; + parts[i].ctype = PT_NONE; + parts[i].life = 0; + } + else + { + parts[i].temp = restrict_flt(elements[parts[i].ctype].LowTemperature - dbt, MIN_TEMP, MAX_TEMP); + s = 0; + } + } + else { - pt = (c_heat - platent[t])/c_Cm; t = parts[i].ctype; parts[i].ctype = PT_NONE; parts[i].life = 0; } - else - { - parts[i].temp = restrict_flt(elements[parts[i].ctype].LowTemperature - dbt, MIN_TEMP, MAX_TEMP); - s = 0; - } -#else - t = parts[i].ctype; - parts[i].ctype = PT_NONE; - parts[i].life = 0; -#endif } } else @@ -2593,21 +2613,24 @@ void Simulation::UpdateParticles(int start, int end) } else if (t == PT_SLTW) { -#ifdef REALISTIC - if (platent[t] <= (c_heat - (elements[t].HighTemperature - dbt)*c_Cm)) + if constexpr (LATENTHEAT) { - pt = (c_heat - platent[t])/c_Cm; + if (elements[t].LatentHeat <= (c_heat - (elements[t].HighTemperature - dbt)*c_Cm)) + { + pt = (c_heat - elements[t].LatentHeat)/c_Cm; - t = rng.chance(1, 4) ? PT_SALT : PT_WTRV; + t = rng.chance(1, 4) ? PT_SALT : PT_WTRV; + } + else + { + parts[i].temp = restrict_flt(elements[t].HighTemperature - dbt, MIN_TEMP, MAX_TEMP); + s = 0; + } } else { - parts[i].temp = restrict_flt(elements[t].HighTemperature - dbt, MIN_TEMP, MAX_TEMP); - s = 0; + t = rng.chance(1, 4) ? PT_SALT : PT_WTRV; } -#else - t = rng.chance(1, 4) ? PT_SALT : PT_WTRV; -#endif } else if (t == PT_BRMT) { @@ -2640,25 +2663,27 @@ void Simulation::UpdateParticles(int start, int end) else if (elements[t].LowTemperatureTransition > -1 && ctempl= (c_heat - (elements[t].LowTemperature - dbt)*c_Cm)) + if constexpr (LATENTHEAT) { - pt = (c_heat + platent[elements[t].LowTemperatureTransition])/c_Cm; - t = elements[t].LowTemperatureTransition; + if (elements[elements[t].LowTemperatureTransition].LatentHeat >= (c_heat - (elements[t].LowTemperature - dbt)*c_Cm)) + { + pt = (c_heat + elements[elements[t].LowTemperatureTransition].LatentHeat)/c_Cm; + t = elements[t].LowTemperatureTransition; + } + else + { + parts[i].temp = restrict_flt(elements[t].LowTemperature - dbt, MIN_TEMP, MAX_TEMP); + s = 0; + } } else { - parts[i].temp = restrict_flt(elements[t].LowTemperature - dbt, MIN_TEMP, MAX_TEMP); - s = 0; + t = elements[t].LowTemperatureTransition; } } -#else - if (elements[t].LowTemperatureTransition != PT_NUM) - t = elements[t].LowTemperatureTransition; -#endif else if (t == PT_WTRV) { t = (pt < 273.0f) ? PT_RIME : PT_DSTW; @@ -2717,13 +2742,14 @@ void Simulation::UpdateParticles(int start, int end) } else s = 0; -#ifdef REALISTIC - pt = restrict_flt(pt, MIN_TEMP, MAX_TEMP); - for (auto j=0; j<8; j++) + if constexpr (LATENTHEAT) { - parts[surround_hconduct[j]].temp = pt; + pt = restrict_flt(pt, MIN_TEMP, MAX_TEMP); + for (auto j=0; j<8; j++) + { + parts[surround_hconduct[j]].temp = pt; + } } -#endif if (s) // particle type change occurred { if (t==PT_ICEI || t==PT_LAVA || t==PT_SNOW) diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index a6a9ba39c..1e101a851 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -98,174 +98,6 @@ static std::vector LoadMenus() }; } -static std::vector LoadLatent() -{ - return - std::vector{ - /* NONE */ 0, - /* DUST */ 0, - /* WATR */ 7500, - /* OIL */ 0, - /* FIRE */ 0, - /* STNE */ 0, - /* LAVA */ 0, - /* GUN */ 0, - /* NITR */ 0, - /* CLNE */ 0, - /* GAS */ 0, - /* C-4 */ 0, - /* GOO */ 0, - /* ICE */ 1095, - /* METL */ 919, - /* SPRK */ 0, - /* SNOW */ 1095, - /* WOOD */ 0, - /* NEUT */ 0, - /* PLUT */ 0, - /* PLNT */ 0, - /* ACID */ 0, - /* VOID */ 0, - /* WTRV */ 0, - /* CNCT */ 0, - /* DSTW */ 7500, - /* SALT */ 0, - /* SLTW */ 7500, - /* DMND */ 0, - /* BMTL */ 0, - /* BRMT */ 0, - /* PHOT */ 0, - /* URAN */ 0, - /* WAX */ 0, - /* MWAX */ 0, - /* PSCN */ 0, - /* NSCN */ 0, - /* LN2 */ 0, - /* INSL */ 0, - /* VACU */ 0, - /* VENT */ 0, - /* RBDM */ 0, - /* LRBD */ 0, - /* NTCT */ 0, - /* SAND */ 0, - /* GLAS */ 0, - /* PTCT */ 0, - /* BGLA */ 0, - /* THDR */ 0, - /* PLSM */ 0, - /* ETRD */ 0, - /* NICE */ 0, - /* NBLE */ 0, - /* BTRY */ 0, - /* LCRY */ 0, - /* STKM */ 0, - /* SWCH */ 0, - /* SMKE */ 0, - /* DESL */ 0, - /* COAL */ 0, - /* LO2 */ 0, - /* O2 */ 0, - /* INWR */ 0, - /* YEST */ 0, - /* DYST */ 0, - /* THRM */ 0, - /* GLOW */ 0, - /* BRCK */ 0, - /* CFLM */ 0, - /* FIRW */ 0, - /* FUSE */ 0, - /* FSEP */ 0, - /* AMTR */ 0, - /* BCOL */ 0, - /* PCLN */ 0, - /* HSWC */ 0, - /* IRON */ 0, - /* MORT */ 0, - /* LIFE */ 0, - /* DLAY */ 0, - /* CO2 */ 0, - /* DRIC */ 0, - /* CBNW */ 7500, - /* STOR */ 0, - /* STOR */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* SPNG */ 0, - /* RIME */ 0, - /* FOG */ 0, - /* BCLN */ 0, - /* LOVE */ 0, - /* DEUT */ 0, - /* WARP */ 0, - /* PUMP */ 0, - /* FWRK */ 0, - /* PIPE */ 0, - /* FRZZ */ 0, - /* FRZW */ 0, - /* GRAV */ 0, - /* BIZR */ 0, - /* BIZRG*/ 0, - /* BIZRS*/ 0, - /* INST */ 0, - /* ISOZ */ 0, - /* ISZS */ 0, - /* PRTI */ 0, - /* PRTO */ 0, - /* PSTE */ 0, - /* PSTS */ 0, - /* ANAR */ 0, - /* VINE */ 0, - /* INVS */ 0, - /* EQVE */ 0, - /* SPWN2*/ 0, - /* SPAWN*/ 0, - /* SHLD1*/ 0, - /* SHLD2*/ 0, - /* SHLD3*/ 0, - /* SHLD4*/ 0, - /* LOlZ */ 0, - /* WIFI */ 0, - /* FILT */ 0, - /* ARAY */ 0, - /* BRAY */ 0, - /* STKM2*/ 0, - /* BOMB */ 0, - /* C-5 */ 0, - /* SING */ 0, - /* QRTZ */ 0, - /* PQRT */ 0, - /* EMP */ 0, - /* BREL */ 0, - /* ELEC */ 0, - /* ACEL */ 0, - /* DCEL */ 0, - /* TNT */ 0, - /* IGNP */ 0, - /* BOYL */ 0, - /* GEL */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* FREE */ 0, - /* WIND */ 0, - /* H2 */ 0, - /* SOAP */ 0, - /* NBHL */ 0, - /* NWHL */ 0, - /* MERC */ 0, - /* PBCN */ 0, - /* GPMP */ 0, - /* CLST */ 0, - /* WIRE */ 0, - /* GBMB */ 0, - /* FIGH */ 0, - /* FRAY */ 0, - /* REPL */ 0, - }; -} - void SimulationData::init_can_move() { int movingType, destinationType; @@ -504,7 +336,6 @@ SimulationData::SimulationData() init_can_move(); msections = LoadMenus(); wtypes = LoadWalls(); - platent = LoadLatent(); elements = GetElements(); tools = GetTools(); } diff --git a/src/simulation/SimulationData.h b/src/simulation/SimulationData.h index 9f92f7725..6f7ae5421 100644 --- a/src/simulation/SimulationData.h +++ b/src/simulation/SimulationData.h @@ -174,7 +174,6 @@ class SimulationData : public ExplicitSingleton public: std::array elements; std::vector tools; - std::vector platent; std::vector wtypes; std::vector msections; char can_move[PT_NUM][PT_NUM]; diff --git a/src/simulation/elements/CBNW.cpp b/src/simulation/elements/CBNW.cpp index ac3b09d1e..0c81ce7d2 100644 --- a/src/simulation/elements/CBNW.cpp +++ b/src/simulation/elements/CBNW.cpp @@ -31,6 +31,7 @@ void Element::Element_CBNW() DefaultProperties.temp = R_TEMP - 2.0f + 273.15f; HeatConduct = 29; + LatentHeat = 7500; Description = "Carbonated water. Slowly releases CO2."; Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE; diff --git a/src/simulation/elements/DSTW.cpp b/src/simulation/elements/DSTW.cpp index 5565bf53b..6d097c327 100644 --- a/src/simulation/elements/DSTW.cpp +++ b/src/simulation/elements/DSTW.cpp @@ -30,6 +30,7 @@ void Element::Element_DSTW() DefaultProperties.temp = R_TEMP - 2.0f + 273.15f; HeatConduct = 23; + LatentHeat = 7500; Description = "Distilled water, does not conduct electricity."; Properties = TYPE_LIQUID|PROP_NEUTPASS; diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp index db533fb9f..a69572184 100644 --- a/src/simulation/elements/ICEI.cpp +++ b/src/simulation/elements/ICEI.cpp @@ -30,6 +30,7 @@ void Element::Element_ICEI() DefaultProperties.temp = R_TEMP - 50.0f + 273.15f; HeatConduct = 46; + LatentHeat = 1095; Description = "Crushes under pressure. Cools down air."; Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_NEUTPASS; diff --git a/src/simulation/elements/METL.cpp b/src/simulation/elements/METL.cpp index bcb3656ef..122fe30cf 100644 --- a/src/simulation/elements/METL.cpp +++ b/src/simulation/elements/METL.cpp @@ -27,6 +27,7 @@ void Element::Element_METL() Weight = 100; HeatConduct = 251; + LatentHeat = 919; Description = "The basic conductor. Meltable."; Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW; diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp index 2a3805f23..95423b398 100644 --- a/src/simulation/elements/SLTW.cpp +++ b/src/simulation/elements/SLTW.cpp @@ -29,6 +29,7 @@ void Element::Element_SLTW() Weight = 35; HeatConduct = 75; + LatentHeat = 7500; Description = "Saltwater, conducts electricity, difficult to freeze."; Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE; diff --git a/src/simulation/elements/SNOW.cpp b/src/simulation/elements/SNOW.cpp index e729db65c..08b273cb0 100644 --- a/src/simulation/elements/SNOW.cpp +++ b/src/simulation/elements/SNOW.cpp @@ -31,6 +31,7 @@ void Element::Element_SNOW() DefaultProperties.temp = R_TEMP - 30.0f + 273.15f; HeatConduct = 46; + LatentHeat = 1095; Description = "Light particles. Created when ICE breaks under pressure."; Properties = TYPE_PART|PROP_NEUTPASS; diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp index 2e82c5e06..849682903 100644 --- a/src/simulation/elements/WATR.cpp +++ b/src/simulation/elements/WATR.cpp @@ -30,6 +30,7 @@ void Element::Element_WATR() DefaultProperties.temp = R_TEMP - 2.0f + 273.15f; HeatConduct = 29; + LatentHeat = 7500; Description = "Water. Conducts electricity, freezes, and extinguishes fires."; Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPASS;