Limit access to the LatentHeat property to LATENTHEAT builds
This commit is contained in:
parent
78314a8f7d
commit
e64c23d50d
@ -55,7 +55,13 @@ Element::Element():
|
||||
|
||||
std::vector<StructProperty> const &Element::GetProperties()
|
||||
{
|
||||
static std::vector<StructProperty> properties = {
|
||||
struct DoOnce
|
||||
{
|
||||
std::vector<StructProperty> properties;
|
||||
|
||||
DoOnce()
|
||||
{
|
||||
properties = {
|
||||
{ "Name", StructProperty::String, offsetof(Element, Name ) },
|
||||
{ "Colour", StructProperty::Colour, offsetof(Element, Colour ) },
|
||||
{ "Color", StructProperty::Colour, offsetof(Element, Colour ) },
|
||||
@ -81,7 +87,6 @@ std::vector<StructProperty> 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 ) },
|
||||
@ -94,7 +99,14 @@ std::vector<StructProperty> const &Element::GetProperties()
|
||||
{ "HighTemperature", StructProperty::Float, offsetof(Element, HighTemperature ) },
|
||||
{ "HighTemperatureTransition", StructProperty::TransitionType, offsetof(Element, HighTemperatureTransition) }
|
||||
};
|
||||
return properties;
|
||||
if constexpr (LATENTHEAT)
|
||||
{
|
||||
properties.push_back({ "LatentHeat", StructProperty::UInteger, offsetof(Element, LatentHeat) });
|
||||
}
|
||||
}
|
||||
};
|
||||
static DoOnce doOnce;
|
||||
return doOnce.properties;
|
||||
}
|
||||
|
||||
int Element::legacyUpdate(UPDATE_FUNC_ARGS) {
|
||||
|
Reference in New Issue
Block a user