forked from teamnwah/openmw-tes3coop
Provide more data when nifstream throws a runtime_error
This commit is contained in:
parent
9213067aee
commit
9ebf3f2f10
2 changed files with 6 additions and 1 deletions
|
@ -74,6 +74,9 @@ public:
|
|||
}
|
||||
/// Number of roots
|
||||
size_t numRoots() const { return roots.size(); }
|
||||
|
||||
/// Get the name of the file
|
||||
std::string getFilename(){ return filename; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <OgreVector4.h>
|
||||
#include <OgreMatrix3.h>
|
||||
#include <OgreQuaternion.h>
|
||||
#include <OgreStringConverter.h>
|
||||
|
||||
#include "niftypes.hpp"
|
||||
|
||||
|
@ -142,7 +143,8 @@ public:
|
|||
std::vector<char> str (length+1, 0);
|
||||
|
||||
if(inp->read(&str[0], length) != length)
|
||||
throw std::runtime_error ("string length in NIF file does not match");
|
||||
throw std::runtime_error (": String length in NIF file "+ file->getFilename() +" does not match! Expected length: "
|
||||
+ Ogre::StringConverter::toString(length));
|
||||
|
||||
return &str[0];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue