1. dodomorandi
  2. minetest-dodomorandi

Commits

dodomorandi  committed fcaaf2f

Don't reinitialize an already initialized metadata

  • Participants
  • Parent commits 0c9b6fe
  • Branches default

Comments (0)

Files changed (1)

File src/map.cpp

View file
 
 	/*
 		Add intial metadata
+		If it's already present, it's been handled elsewhere
 	*/
 
-	NodeMetadata *meta_proto = content_features(n).initial_metadata;
-	if(meta_proto)
+	if(not getNodeMetadata(p))
 	{
-		NodeMetadata *meta = meta_proto->clone();
-		setNodeMetadata(p, meta);
+		NodeMetadata *meta_proto = content_features(n).initial_metadata;
+		if(meta_proto)
+		{
+			NodeMetadata *meta = meta_proto->clone();
+			setNodeMetadata(p, meta);
+		}
 	}
 
 	/*