From 9d0006fecbb164e9cc596a0ea3b95f9b1b8355f1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 18 Jan 2022 21:32:06 +0100 Subject: [PATCH] Revert change --- code/AssetLib/B3D/B3DImporter.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/AssetLib/B3D/B3DImporter.cpp b/code/AssetLib/B3D/B3DImporter.cpp index 78d26bdcc..6a0c09ee9 100644 --- a/code/AssetLib/B3D/B3DImporter.cpp +++ b/code/AssetLib/B3D/B3DImporter.cpp @@ -89,11 +89,22 @@ void DeleteAllBarePointers(std::vector &x) { } B3DImporter::~B3DImporter() { + // empty } // ------------------------------------------------------------------------------------------------ bool B3DImporter::CanRead(const std::string & /*pFile*/, IOSystem * /*pIOHandler*/, bool /*checkSig*/) const { - return false; + size_t pos = pFile.find_last_of('.'); + if (pos == string::npos) { + return false; + } + + string ext = pFile.substr(pos + 1); + if (ext.size() != 3) { + return false; + } + + return (ext[0] == 'b' || ext[0] == 'B') && (ext[1] == '3') && (ext[2] == 'd' || ext[2] == 'D'); } // ------------------------------------------------------------------------------------------------