From: Thorn Date: Tue, 18 Oct 2011 13:01:18 +0000 (+0200) Subject: A tiny patch for the brushexport2 obj exporter that stops it from truncating filename... X-Git-Tag: xonotic-v0.6.0~64 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=6a27f87936c7b37999a9584ca1b48790553bfe64;p=xonotic%2Fnetradiant.git A tiny patch for the brushexport2 obj exporter that stops it from truncating filenames if you don't specifically append ".obj" in the file browser window. --- diff --git a/contrib/brushexport/export.cpp b/contrib/brushexport/export.cpp index 0407432e..bd71b993 100644 --- a/contrib/brushexport/export.cpp +++ b/contrib/brushexport/export.cpp @@ -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 materials;