]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
A tiny patch for the brushexport2 obj exporter that stops it from truncating filename...
authorThorn <Thorn@dev.xonotic.org.invalid>
Tue, 18 Oct 2011 13:01:18 +0000 (15:01 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 18 Oct 2011 13:01:18 +0000 (15:01 +0200)
contrib/brushexport/export.cpp

index 0407432e35d6c4b56589b07d9c1b72b64ac3dc4a..bd71b9939c9d475f398d7f029b9cdb2a334d4a40 100644 (file)
@@ -180,8 +180,12 @@ public:
 
 bool ExportDataAsWavefront::WriteToFile(const std::string& path, collapsemode mode) const
 {
-       std::string objFile = path.substr(0, path.length() -4) + ".obj";
-       std::string mtlFile = path.substr(0, path.length() -4) + ".mtl";
+       std::string objFile = path;
+
+       if(path.compare(path.length() - 4, 4, ".obj") != 0)
+               objFile += ".obj";
+
+       std::string mtlFile = objFile.substr(0, objFile.length() -4) + ".mtl";
 
        std::set<std::string> materials;