]> git.lizzy.rs Git - minetest.git/blobdiff - src/content_inventory.cpp
Fix some "Conditional jump or move depends on uninitialised value(s)" valgrind detections
[minetest.git] / src / content_inventory.cpp
index 5fbb02d9b3d99b1f7a7d7a8654fd88e32bca67b4..59997ee4b69a6902896c566c172dfefe51bafc4d 100644 (file)
@@ -73,6 +73,8 @@ std::string item_craft_get_image_name(const std::string &subname)
                return "firefly.png";
        else if(subname == "apple")
                return "apple.png";
+               else if(subname == "apple_iron")
+               return "apple_iron.png";
        else
                return "cloud.png"; // just something
 }
@@ -96,7 +98,7 @@ ServerActiveObject* item_craft_create_object(const std::string &subname,
 
 s16 item_craft_get_drop_count(const std::string &subname)
 {
-       if(subname == "rat" || subname == "firefly" || subname == "apple")
+       if(subname == "rat" || subname == "firefly")
                return 1;
 
        return -1;
@@ -130,6 +132,8 @@ bool item_craft_is_eatable(const std::string &subname)
                return true;
        else if(subname == "apple")
                return true;
+       else if(subname == "apple_iron")
+               return true;
        return false;
 }
 
@@ -138,7 +142,9 @@ s16 item_craft_eat_hp_change(const std::string &subname)
        if(subname == "cooked_rat")
                return 6; // 3 hearts
        else if(subname == "apple")
-               return 12; // 6 hearts
+               return 4; // 2 hearts
+       else if(subname == "apple_iron")
+               return 8; // 4 hearts
        return 0;
 }