Guest User

Untitled

a guest
Oct 21st, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.14 KB | None | 0 0
  1. diff -Naur src-old/content_craft.cpp src/content_craft.cpp
  2. --- src-old/content_craft.cpp   2011-09-03 21:09:18.000000000 +0200
  3. +++ src/content_craft.cpp   2011-09-03 21:57:00.000000000 +0200
  4. @@ -429,6 +429,18 @@
  5.         }
  6.     }
  7.  
  8. +   // Bucket
  9. +   {
  10. +       ItemSpec specs[9];
  11. +       specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
  12. +       specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
  13. +       specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
  14. +       if(checkItemCombination(items, specs))
  15. +       {
  16. +           return new ToolItem("Bucket", 0);
  17. +       }
  18. +   }
  19. +
  20.     return NULL;
  21.  }
  22.  
  23. diff -Naur src-old/content_mapnode.cpp src/content_mapnode.cpp
  24. --- src-old/content_mapnode.cpp 2011-09-03 21:09:18.000000000 +0200
  25. +++ src/content_mapnode.cpp 2011-09-03 22:33:02.000000000 +0200
  26. @@ -366,12 +366,17 @@
  27.     f->light_propagates = true;
  28.     f->solidness = 0; // Drawn separately, makes no faces
  29.     f->walkable = false;
  30. -   f->pointable = false;
  31. -   f->diggable = false;
  32. +   // water and watersource are pointable, but the pointing code doesn't
  33. +   // allow pointing it unless we're holding a bucket
  34. +   f->pointable = true;
  35. +   f->diggable = true;
  36.     f->buildable_to = true;
  37. +   f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WATERSOURCE)+" 1";
  38.     f->liquid_type = LIQUID_FLOWING;
  39.     f->liquid_alternative_flowing = CONTENT_WATER;
  40.     f->liquid_alternative_source = CONTENT_WATERSOURCE;
  41. +   f->digging_properties.set("",       DiggingProperties(false, 0.0, 0));
  42. +   f->digging_properties.set("Bucket", DiggingProperties(true,  0.0, 0));
  43.    
  44.     i = CONTENT_WATERSOURCE;
  45.     f = &content_features(i);
  46. @@ -397,13 +402,15 @@
  47.     f->param_type = CPT_LIGHT;
  48.     f->light_propagates = true;
  49.     f->walkable = false;
  50. -   f->pointable = false;
  51. -   f->diggable = false;
  52. +   f->pointable = true;
  53. +   f->diggable = true;
  54.     f->buildable_to = true;
  55.     f->liquid_type = LIQUID_SOURCE;
  56.     f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
  57.     f->liquid_alternative_flowing = CONTENT_WATER;
  58.     f->liquid_alternative_source = CONTENT_WATERSOURCE;
  59. +   f->digging_properties.set("",       DiggingProperties(false, 0.0, 0));
  60. +   f->digging_properties.set("Bucket", DiggingProperties(true,  0.0, 0));
  61.    
  62.     i = CONTENT_TORCH;
  63.     f = &content_features(i);
  64. @@ -513,6 +520,7 @@
  65.     */
  66.     for(u16 i=0; i<=MAX_CONTENT; i++)
  67.     {
  68. +       if (i == CONTENT_WATER || i == CONTENT_WATERSOURCE) continue;
  69.         content_features(i).digging_properties.set("MesePick",
  70.                 DiggingProperties(true, 0.0, 65535./1337));
  71.     }
  72. diff -Naur src-old/game.cpp src/game.cpp
  73. --- src-old/game.cpp    2011-09-03 21:09:18.000000000 +0200
  74. +++ src/game.cpp    2011-09-03 22:38:02.000000000 +0200
  75. @@ -394,6 +394,19 @@
  76.         core::aabbox3d<f32> &nodehilightbox,
  77.         f32 d)
  78.  {
  79. +   // Get tool name. Default is "" = bare hands
  80. +   std::string toolname = "";
  81. +   InventoryList *mlist = local_inventory.getList("main");
  82. +   if(mlist != NULL)
  83. +   {
  84. +       InventoryItem *item = mlist->getItem(g_selected_item);
  85. +       if(item && (std::string)item->getName() == "ToolItem")
  86. +       {
  87. +           ToolItem *titem = (ToolItem*)item;
  88. +           toolname = titem->getToolName();
  89. +       }
  90. +   }
  91. +
  92.     f32 mindistance = BS * 1001;
  93.    
  94.     v3s16 pos_i = floatToInt(player_position, BS);
  95. @@ -408,7 +421,7 @@
  96.     s16 yend = pos_i.Y + 1 + (camera_direction.Y>0 ? a : 1);
  97.     s16 zend = pos_i.Z + (camera_direction.Z>0 ? a : 1);
  98.     s16 xend = pos_i.X + (camera_direction.X>0 ? a : 1);
  99. -  
  100. +
  101.     for(s16 y = ystart; y <= yend; y++)
  102.     for(s16 z = zstart; z <= zend; z++)
  103.     for(s16 x = xstart; x <= xend; x++)
  104. @@ -425,6 +438,15 @@
  105.             continue;
  106.         }
  107.  
  108. +       // exception for water and watersource, which are pointable now
  109. +       // allow pointing with bucket equipped only
  110. +       if (
  111. +           toolname != "Bucket"
  112. +       && (
  113. +           n.getContent() == CONTENT_WATER
  114. +        || n.getContent() == CONTENT_WATERSOURCE
  115. +       )) continue;
  116. +
  117.         v3s16 np(x,y,z);
  118.         v3f npf = intToFloat(np, BS);
  119.        
  120. diff -Naur src-old/inventory.h src/inventory.h
  121. --- src-old/inventory.h 2011-09-03 21:09:18.000000000 +0200
  122. +++ src/inventory.h 2011-09-03 21:34:18.000000000 +0200
  123. @@ -383,6 +383,8 @@
  124.             basename = "tool_stonesword.png";
  125.         else if(m_toolname == "SteelSword")
  126.             basename = "tool_steelsword.png";
  127. +       else if(m_toolname == "Bucket")
  128. +           basename = "tool_bucket.png";
  129.         else
  130.             basename = "cloud.png";
Add Comment
Please, Sign In to add comment