remove some deprecated stuff

This commit is contained in:
darkrose 2015-01-07 23:29:57 +10:00
parent c6432b2ca8
commit 548eaa2db9
4 changed files with 12 additions and 97 deletions

View File

@ -962,7 +962,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
v3s16 p2 = p + dirs[i]; v3s16 p2 = p + dirs[i];
bool pos_ok; bool pos_ok;
MapNode n2 = getNodeNoEx(p2,&pos_ok); MapNode n2 = getNodeNoEx(p2,&pos_ok);
if (pos_ok && (content_liquid(n2.getContent()) || n2.getContent() == CONTENT_AIR)) if (pos_ok && (content_features(n2).liquid_type != LIQUID_NONE || n2.getContent() == CONTENT_AIR))
m_transforming_liquid.push_back(p2); m_transforming_liquid.push_back(p2);
} }
} }
@ -1112,7 +1112,7 @@ void Map::removeNodeAndUpdate(v3s16 p,
v3s16 p2 = p + dirs[i]; v3s16 p2 = p + dirs[i];
MapNode n2 = getNodeNoEx(p2,&pos_ok); MapNode n2 = getNodeNoEx(p2,&pos_ok);
if (pos_ok && (content_liquid(n2.getContent()) || n2.getContent() == CONTENT_AIR)) if (pos_ok && (content_features(n2).liquid_type != LIQUID_NONE || n2.getContent() == CONTENT_AIR))
m_transforming_liquid.push_back(p2); m_transforming_liquid.push_back(p2);
} }
} }

View File

@ -614,87 +614,6 @@ struct ContentFeatures
ContentFeatures & content_features(content_t i); ContentFeatures & content_features(content_t i);
ContentFeatures & content_features(MapNode &n); ContentFeatures & content_features(MapNode &n);
/*
Here is a bunch of DEPRECATED functions.
*/
/*
If true, the material allows light propagation and brightness is stored
in param.
NOTE: Don't use, use "content_features(m).whatever" instead
*/
inline bool light_propagates_content(content_t m)
{
return content_features(m).light_propagates;
}
/*
If true, the material allows lossless sunlight propagation.
NOTE: It doesn't seem to go through torches regardlessly of this
NOTE: Don't use, use "content_features(m).whatever" instead
*/
inline bool sunlight_propagates_content(content_t m)
{
return content_features(m).sunlight_propagates;
}
/*
On a node-node surface, the material of the node with higher solidness
is used for drawing.
0: Invisible
1: Transparent
2: Opaque
NOTE: Don't use, use "content_features(m).whatever" instead
*/
inline u8 content_solidness(content_t m)
{
return content_features(m).solidness;
}
// Objects collide with walkable contents
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_walkable(content_t m)
{
return content_features(m).walkable;
}
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_liquid(content_t m)
{
return content_features(m).liquid_type != LIQUID_NONE;
}
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_flowing_liquid(content_t m)
{
return content_features(m).liquid_type == LIQUID_FLOWING;
}
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_liquid_source(content_t m)
{
return content_features(m).liquid_type == LIQUID_SOURCE;
}
// CONTENT_WATER || CONTENT_WATERSOURCE -> CONTENT_WATER
// CONTENT_LAVA || CONTENT_LAVASOURCE -> CONTENT_LAVA
// NOTE: Don't use, use "content_features(m).whatever" instead
inline content_t make_liquid_flowing(content_t m)
{
u8 c = content_features(m).liquid_alternative_flowing;
assert(c != CONTENT_IGNORE);
return c;
}
// Pointable contents can be pointed to in the map
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_pointable(content_t m)
{
return content_features(m).pointable;
}
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_diggable(content_t m)
{
return content_features(m).diggable;
}
// NOTE: Don't use, use "content_features(m).whatever" instead
inline bool content_buildable_to(content_t m)
{
return content_features(m).buildable_to;
}
/* /*
Nodes make a face if contents differ and solidness differs. Nodes make a face if contents differ and solidness differs.
Return value: Return value:
@ -879,15 +798,15 @@ struct MapNode
*/ */
bool light_propagates() bool light_propagates()
{ {
return light_propagates_content(getContent()); return content_features(*this).light_propagates;
} }
bool sunlight_propagates() bool sunlight_propagates()
{ {
return sunlight_propagates_content(getContent()); return content_features(*this).sunlight_propagates;
} }
u8 solidness() u8 solidness()
{ {
return content_solidness(getContent()); return content_features(*this).solidness;
} }
u8 light_source() u8 light_source()
{ {

View File

@ -716,11 +716,11 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
// If in water, the threshold of coming out is at higher y // If in water, the threshold of coming out is at higher y
if (in_water) { if (in_water) {
v3s16 pp = floatToInt(position + v3f(0,BS*0.1,0), BS); v3s16 pp = floatToInt(position + v3f(0,BS*0.1,0), BS);
in_water = content_liquid(map.getNode(pp).getContent()); in_water = content_features(map.getNode(pp).getContent()).liquid_type != LIQUID_NONE;
// If not in water, the threshold of going in is at lower y // If not in water, the threshold of going in is at lower y
}else{ }else{
v3s16 pp = floatToInt(position + v3f(0,BS*0.5,0), BS); v3s16 pp = floatToInt(position + v3f(0,BS*0.5,0), BS);
in_water = content_liquid(map.getNode(pp).getContent()); in_water = content_features(map.getNode(pp).getContent()).liquid_type != LIQUID_NONE;
} }
}catch(InvalidPositionException &e) { }catch(InvalidPositionException &e) {
in_water = false; in_water = false;
@ -731,7 +731,7 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
*/ */
try{ try{
v3s16 pp = floatToInt(position + v3f(0,0,0), BS); v3s16 pp = floatToInt(position + v3f(0,0,0), BS);
in_water_stable = content_liquid(map.getNode(pp).getContent()); in_water_stable = content_features(map.getNode(pp).getContent()).liquid_type != LIQUID_NONE;
}catch(InvalidPositionException &e) { }catch(InvalidPositionException &e) {
in_water_stable = false; in_water_stable = false;
} }

View File

@ -3001,11 +3001,9 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
// Get material at position // Get material at position
material = n.getContent(); material = n.getContent();
// If not yet cancelled // If not yet cancelled
if(cannot_remove_node == false) if (cannot_remove_node == false) {
{
// If it's not diggable, do nothing // If it's not diggable, do nothing
if(content_diggable(material) == false) if (content_features(material).diggable == false) {
{
infostream<<"Server: Not finishing digging: " infostream<<"Server: Not finishing digging: "
<<"Node not diggable" <<"Node not diggable"
<<std::endl; <<std::endl;
@ -3013,12 +3011,10 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
} }
} }
// If not yet cancelled // If not yet cancelled
if(cannot_remove_node == false) if (cannot_remove_node == false) {
{
// Get node metadata // Get node metadata
NodeMetadata *meta = m_env.getMap().getNodeMetadata(p_under); NodeMetadata *meta = m_env.getMap().getNodeMetadata(p_under);
if(meta && meta->nodeRemovalDisabled() == true) if (meta && meta->nodeRemovalDisabled() == true) {
{
infostream<<"Server: Not finishing digging: " infostream<<"Server: Not finishing digging: "
<<"Node metadata disables removal" <<"Node metadata disables removal"
<<std::endl; <<std::endl;