Tune caves
[oweals/minetest.git] / src / tile.cpp
index fc371c9417ae16c949a462afa03de283c079fbeb..c35952b782e460df83b12724385e648a8b5c707f 100644 (file)
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mapnode.h" // For texture atlas making
 #include "nodedef.h" // For texture atlas making
 #include "gamedef.h"
+#include "utility_string.h"
 
 /*
        A cache from texture name to texture path
@@ -82,7 +83,10 @@ static std::string getImagePath(std::string path)
                "pcx", "ppm", "psd", "wal", "rgb",
                NULL
        };
-
+       // If there is no extension, add one
+       if(removeStringEnd(path, extensions) == "")
+               path = path + ".png";
+       // Check paths until something is found to exist
        const char **ext = extensions;
        do{
                bool r = replace_ext(path, *ext);
@@ -132,9 +136,9 @@ std::string getTexturePath(const std::string &filename)
        */
        if(fullpath == "")
        {
-               std::string rel_path = std::string("client")
-                               + DIR_DELIM + "textures" + DIR_DELIM + filename;
-               std::string testpath = porting::path_share + DIR_DELIM + rel_path;
+               std::string base_path = porting::path_share + DIR_DELIM + "textures"
+                               + DIR_DELIM + "base" + DIR_DELIM + "pack";
+               std::string testpath = base_path + DIR_DELIM + filename;
                // Check all filename extensions. Returns "" if not found.
                fullpath = getImagePath(testpath);
        }