Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Naur src-old/content_craft.cpp src/content_craft.cpp
- --- src-old/content_craft.cpp 2011-09-03 21:09:18.000000000 +0200
- +++ src/content_craft.cpp 2011-09-03 21:57:00.000000000 +0200
- @@ -429,6 +429,18 @@
- }
- }
- + // Bucket
- + {
- + ItemSpec specs[9];
- + specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
- + specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
- + specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
- + if(checkItemCombination(items, specs))
- + {
- + return new ToolItem("Bucket", 0);
- + }
- + }
- +
- return NULL;
- }
- diff -Naur src-old/content_mapnode.cpp src/content_mapnode.cpp
- --- src-old/content_mapnode.cpp 2011-09-03 21:09:18.000000000 +0200
- +++ src/content_mapnode.cpp 2011-09-03 22:33:02.000000000 +0200
- @@ -366,12 +366,17 @@
- f->light_propagates = true;
- f->solidness = 0; // Drawn separately, makes no faces
- f->walkable = false;
- - f->pointable = false;
- - f->diggable = false;
- + // water and watersource are pointable, but the pointing code doesn't
- + // allow pointing it unless we're holding a bucket
- + f->pointable = true;
- + f->diggable = true;
- f->buildable_to = true;
- + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WATERSOURCE)+" 1";
- f->liquid_type = LIQUID_FLOWING;
- f->liquid_alternative_flowing = CONTENT_WATER;
- f->liquid_alternative_source = CONTENT_WATERSOURCE;
- + f->digging_properties.set("", DiggingProperties(false, 0.0, 0));
- + f->digging_properties.set("Bucket", DiggingProperties(true, 0.0, 0));
- i = CONTENT_WATERSOURCE;
- f = &content_features(i);
- @@ -397,13 +402,15 @@
- f->param_type = CPT_LIGHT;
- f->light_propagates = true;
- f->walkable = false;
- - f->pointable = false;
- - f->diggable = false;
- + f->pointable = true;
- + f->diggable = true;
- f->buildable_to = true;
- f->liquid_type = LIQUID_SOURCE;
- f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
- f->liquid_alternative_flowing = CONTENT_WATER;
- f->liquid_alternative_source = CONTENT_WATERSOURCE;
- + f->digging_properties.set("", DiggingProperties(false, 0.0, 0));
- + f->digging_properties.set("Bucket", DiggingProperties(true, 0.0, 0));
- i = CONTENT_TORCH;
- f = &content_features(i);
- @@ -513,6 +520,7 @@
- */
- for(u16 i=0; i<=MAX_CONTENT; i++)
- {
- + if (i == CONTENT_WATER || i == CONTENT_WATERSOURCE) continue;
- content_features(i).digging_properties.set("MesePick",
- DiggingProperties(true, 0.0, 65535./1337));
- }
- diff -Naur src-old/game.cpp src/game.cpp
- --- src-old/game.cpp 2011-09-03 21:09:18.000000000 +0200
- +++ src/game.cpp 2011-09-03 22:38:02.000000000 +0200
- @@ -394,6 +394,19 @@
- core::aabbox3d<f32> &nodehilightbox,
- f32 d)
- {
- + // Get tool name. Default is "" = bare hands
- + std::string toolname = "";
- + InventoryList *mlist = local_inventory.getList("main");
- + if(mlist != NULL)
- + {
- + InventoryItem *item = mlist->getItem(g_selected_item);
- + if(item && (std::string)item->getName() == "ToolItem")
- + {
- + ToolItem *titem = (ToolItem*)item;
- + toolname = titem->getToolName();
- + }
- + }
- +
- f32 mindistance = BS * 1001;
- v3s16 pos_i = floatToInt(player_position, BS);
- @@ -408,7 +421,7 @@
- s16 yend = pos_i.Y + 1 + (camera_direction.Y>0 ? a : 1);
- s16 zend = pos_i.Z + (camera_direction.Z>0 ? a : 1);
- s16 xend = pos_i.X + (camera_direction.X>0 ? a : 1);
- -
- +
- for(s16 y = ystart; y <= yend; y++)
- for(s16 z = zstart; z <= zend; z++)
- for(s16 x = xstart; x <= xend; x++)
- @@ -425,6 +438,15 @@
- continue;
- }
- + // exception for water and watersource, which are pointable now
- + // allow pointing with bucket equipped only
- + if (
- + toolname != "Bucket"
- + && (
- + n.getContent() == CONTENT_WATER
- + || n.getContent() == CONTENT_WATERSOURCE
- + )) continue;
- +
- v3s16 np(x,y,z);
- v3f npf = intToFloat(np, BS);
- diff -Naur src-old/inventory.h src/inventory.h
- --- src-old/inventory.h 2011-09-03 21:09:18.000000000 +0200
- +++ src/inventory.h 2011-09-03 21:34:18.000000000 +0200
- @@ -383,6 +383,8 @@
- basename = "tool_stonesword.png";
- else if(m_toolname == "SteelSword")
- basename = "tool_steelsword.png";
- + else if(m_toolname == "Bucket")
- + basename = "tool_bucket.png";
- else
- basename = "cloud.png";
Add Comment
Please, Sign In to add comment