aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-25 15:38:18 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:51 +0200
commit6a8f9135de448d805457e0b1f561c711d760565e (patch)
tree784ba14cc7cc6f759d76480b154b685a413d5207 /src/nodedef.cpp
parent704d8a62bf4c52c5ac0d9a85b0b902ea833a7e90 (diff)
downloadhax-minetest-server-6a8f9135de448d805457e0b1f561c711d760565e.tar.gz
hax-minetest-server-6a8f9135de448d805457e0b1f561c711d760565e.zip
Store metadata as metadata name in node definition
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index a32851974..956bc1a5f 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -89,7 +89,6 @@ ContentFeatures::ContentFeatures()
ContentFeatures::~ContentFeatures()
{
- delete initial_metadata;
#ifndef SERVER
for(u16 j=0; j<CF_SPECIAL_COUNT; j++){
delete special_materials[j];
@@ -143,7 +142,7 @@ void ContentFeatures::reset()
dug_item = "";
extra_dug_item = "";
extra_dug_item_rarity = 2;
- initial_metadata = NULL;
+ metadata_name = "";
liquid_type = LIQUID_NONE;
liquid_alternative_flowing = CONTENT_IGNORE;
liquid_alternative_source = CONTENT_IGNORE;
@@ -191,12 +190,7 @@ void ContentFeatures::serialize(std::ostream &os)
os<<serializeString(dug_item);
os<<serializeString(extra_dug_item);
writeS32(os, extra_dug_item_rarity);
- if(initial_metadata){
- writeU8(os, true);
- initial_metadata->serialize(os);
- } else {
- writeU8(os, false);
- }
+ os<<serializeString(metadata_name);
writeU8(os, liquid_type);
writeU16(os, liquid_alternative_flowing);
writeU16(os, liquid_alternative_source);
@@ -248,11 +242,7 @@ void ContentFeatures::deSerialize(std::istream &is, IGameDef *gamedef)
dug_item = deSerializeString(is);
extra_dug_item = deSerializeString(is);
extra_dug_item_rarity = readS32(is);
- if(readU8(is)){
- initial_metadata = NodeMetadata::deSerialize(is, gamedef);
- } else {
- initial_metadata = NULL;
- }
+ metadata_name = deSerializeString(is);
liquid_type = (enum LiquidType)readU8(is);
liquid_alternative_flowing = readU16(is);
liquid_alternative_source = readU16(is);