Remove freezemelt (the remainder of proller nonsense)

This commit is contained in:
kwolekr 2015-01-04 03:30:10 -05:00
parent 8eb9cebdd0
commit 6fdb32361a
5 changed files with 16 additions and 36 deletions

@ -439,23 +439,6 @@ u8 MapNode::addLevel(INodeDefManager *nodemgr, s8 add)
return setLevel(nodemgr, level); return setLevel(nodemgr, level);
} }
void MapNode::freezeMelt(INodeDefManager *ndef) {
u8 level_was_max = this->getMaxLevel(ndef);
u8 level_was = this->getLevel(ndef);
this->setContent(ndef->getId(ndef->get(*this).freezemelt));
u8 level_now_max = this->getMaxLevel(ndef);
if (level_was_max && level_was_max != level_now_max) {
u8 want = (float)level_now_max / level_was_max * level_was;
if (!want)
want = 1;
if (want != level_was)
this->setLevel(ndef, want);
//errorstream<<"was="<<(int)level_was<<"/"<<(int)level_was_max<<" nowm="<<(int)want<<"/"<<(int)level_now_max<< " => "<<(int)this->getLevel(ndef)<< std::endl;
}
if (this->getMaxLevel(ndef) && !this->getLevel(ndef))
this->addLevel(ndef);
}
u32 MapNode::serializedLength(u8 version) u32 MapNode::serializedLength(u8 version)
{ {
if(!ser_ver_supported(version)) if(!ser_ver_supported(version))

@ -241,12 +241,13 @@ struct MapNode
*/ */
std::vector<aabb3f> getCollisionBoxes(INodeDefManager *nodemgr) const; std::vector<aabb3f> getCollisionBoxes(INodeDefManager *nodemgr) const;
/* Liquid helpers */ /*
Liquid helpers
*/
u8 getMaxLevel(INodeDefManager *nodemgr) const; u8 getMaxLevel(INodeDefManager *nodemgr) const;
u8 getLevel(INodeDefManager *nodemgr) const; u8 getLevel(INodeDefManager *nodemgr) const;
u8 setLevel(INodeDefManager *nodemgr, s8 level = 1); u8 setLevel(INodeDefManager *nodemgr, s8 level = 1);
u8 addLevel(INodeDefManager *nodemgr, s8 add = 1); u8 addLevel(INodeDefManager *nodemgr, s8 add = 1);
void freezeMelt(INodeDefManager *nodemgr);
/* /*
Serialization functions Serialization functions

@ -227,7 +227,6 @@ void ContentFeatures::reset()
liquid_alternative_source = ""; liquid_alternative_source = "";
liquid_viscosity = 0; liquid_viscosity = 0;
liquid_renewable = true; liquid_renewable = true;
freezemelt = "";
liquid_range = LIQUID_LEVEL_MAX+1; liquid_range = LIQUID_LEVEL_MAX+1;
drowning = 0; drowning = 0;
light_source = 0; light_source = 0;

@ -234,8 +234,6 @@ struct ContentFeatures
u8 liquid_viscosity; u8 liquid_viscosity;
// Is liquid renewable (new liquid source will be created between 2 existing) // Is liquid renewable (new liquid source will be created between 2 existing)
bool liquid_renewable; bool liquid_renewable;
// Ice for water, water for ice
std::string freezemelt;
// Number of flowing liquids surrounding source // Number of flowing liquids surrounding source
u8 liquid_range; u8 liquid_range;
u8 drowning; u8 drowning;

@ -414,7 +414,6 @@ ContentFeatures read_content_features(lua_State *L, int index)
f.leveled = getintfield_default(L, index, "leveled", f.leveled); f.leveled = getintfield_default(L, index, "leveled", f.leveled);
getboolfield(L, index, "liquid_renewable", f.liquid_renewable); getboolfield(L, index, "liquid_renewable", f.liquid_renewable);
getstringfield(L, index, "freezemelt", f.freezemelt);
f.drowning = getintfield_default(L, index, f.drowning = getintfield_default(L, index,
"drowning", f.drowning); "drowning", f.drowning);
// Amount of light the node emits // Amount of light the node emits