MapNode
*/
+// Create directly from a nodename
+// If name is unknown, sets CONTENT_IGNORE
+MapNode::MapNode(INodeDefManager *ndef, const std::string &name,
+ u8 a_param1, u8 a_param2)
+{
+ content_t id = CONTENT_IGNORE;
+ ndef->getId(name, id);
+ param1 = a_param1;
+ param2 = a_param2;
+ // Set content (param0 and (param2&0xf0)) after other params
+ // because this needs to override part of param2
+ setContent(id);
+}
+
void MapNode::setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr)
{
// If node doesn't contain light data, ignore this
dest[2] = n_foreign.param2;
}
}
-void MapNode::deSerialize(u8 *source, u8 version, INodeDefManager *nodemgr)
+void MapNode::deSerialize(u8 *source, u8 version)
{
if(!ser_ver_supported(version))
throw VersionMismatchException("ERROR: MapNode format not supported");
else if(version == 1)
{
param0 = source[0];
- // This version doesn't support saved lighting
- if(nodemgr->get(*this).light_propagates || nodemgr->get(*this).light_source > 0)
- param1 = 0;
- else
- param1 = source[1];
}
else if(version <= 9)
{