summaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-19 19:06:19 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:49 +0200
commit811ac5ac3ae6de6ee152f724aaf392ac73c3ed40 (patch)
treef2c85d02f5abf1ee72c62ec6d33933f36ff4fb6d /src/nodedef.cpp
parent901d98b687d9681b83aface7e6697d6937023024 (diff)
downloadminetest-811ac5ac3ae6de6ee152f724aaf392ac73c3ed40.tar.gz
minetest-811ac5ac3ae6de6ee152f724aaf392ac73c3ed40.tar.bz2
minetest-811ac5ac3ae6de6ee152f724aaf392ac73c3ed40.zip
Mess up with node definitions to make CONTENT_IGNORE be correctly interpreted when creating meshes
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index de724659b..0e48c8c07 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -347,13 +347,13 @@ public:
ContentFeatures f;
f.name = "ignore";
f.drawtype = NDT_AIRLIKE;
- f.param_type = CPT_LIGHT;
+ /*f.param_type = CPT_LIGHT;
f.light_propagates = true;
- f.sunlight_propagates = true;
+ f.sunlight_propagates = true;*/
f.walkable = false;
f.pointable = false;
f.diggable = false;
- f.buildable_to = true;
+ f.buildable_to = false;
f.air_equivalent = true;
set(CONTENT_IGNORE, f);
}
@@ -424,6 +424,15 @@ public:
infostream<<"registerNode: registering content id \""<<c
<<"\": name=\""<<def.name<<"\""<<std::endl;
assert(c <= MAX_CONTENT);
+ // Check that the special contents are not redefined as different id
+ // because it would mess up everything
+ if((def.name == "ignore" && c != CONTENT_IGNORE) ||
+ (def.name == "air" && c != CONTENT_AIR)){
+ errorstream<<"registerNode: IGNORING ERROR: "
+ <<"trying to register built-in type \""
+ <<def.name<<"\" as different id"<<std::endl;
+ return;
+ }
m_content_features[c] = def;
if(def.name != "")
m_name_id_mapping.set(c, def.name);
@@ -615,6 +624,9 @@ public:
<<"Too large content id: "<<i<<std::endl;
continue;
}
+ /*// Do not deserialize special types
+ if(i == CONTENT_IGNORE || i == CONTENT_AIR)
+ continue;*/
ContentFeatures *f = &m_content_features[i];
f->deSerialize(tmp_is, gamedef);
if(f->name != "")