Merged CiaranG's fence and fixed two things
authorPerttu Ahola <celeron55@gmail.com>
Tue, 24 May 2011 17:13:21 +0000 (20:13 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 24 May 2011 17:13:21 +0000 (20:13 +0300)
1  2 
src/mapnode.cpp
src/mapnode.h
src/server.cpp

diff --cc src/mapnode.cpp
index c8e4e8449f1cae1b5ccdc25288a4bcebcfaebf28,199a5c656b896b0aa6d830efd5a61ced9eb74ddb..ca36697efa93f1e2fd01f1cccd468be0c719a74c
@@@ -216,6 -216,13 +216,14 @@@ void init_mapnode(
        f->solidness = 0; // drawn separately, makes no faces
        f->setInventoryTextureCube("glass.png", "glass.png", "glass.png");
  
+       i = CONTENT_FENCE;
+       f = &g_content_features[i];
+       f->light_propagates = true;
+       f->param_type = CPT_LIGHT;
+       f->is_ground_content = true;
+       f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
+       f->solidness = 0; // drawn separately, makes no faces
++      f->air_equivalent = true; // grass grows underneath
  
        // Deprecated
        i = CONTENT_COALSTONE;
diff --cc src/mapnode.h
Simple merge
diff --cc src/server.cpp
index 5c03ea8f6ffd7a9c810cc440a01ed5f3d58890be,75b47e498f50af5ead900118257f10e9236b1172..9248e62984696caf7f5ba0f305aa9cbddedcecc9
@@@ -3664,6 -3670,23 +3670,23 @@@ void Server::UpdateCrafting(u16 peer_id
                                }
                        }
  
 -                              specs[9] = ItemSpec(ITEM_CRAFT, "Stick");
+                       // Fence
+                       if(!found)
+                       {
+                               ItemSpec specs[9];
++                              specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
+                               specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
+                               specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
+                               specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
+                               specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
+                               specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
+                               if(checkItemCombination(items, specs))
+                               {
+                                       rlist->addItem(new MaterialItem(CONTENT_FENCE, 2));
+                                       found = true;
+                               }
+                       }
                        // Sign
                        if(!found)
                        {