Resurrecting this thread since I was planning to use the esmtool, and then found out that it doesn't print the records of weapons. First though a couple of issues I wanted to tackle.
issue #1:
Zini wrote:@lgro: Since you were planning to revamp the esmtool anyway, could you have a look at this bug I found:
esmtool: /home/marc/OpenMW/openmw/components/to_utf8/to_utf8.cpp:152: std::string ToUTF8::getUtf8(ToUTF8::FromType): Assertion `0' failed.
Happens when running the esmtool with a non-English Morrowind.esm. I assume the encoding fixes in OpenMW broke something in the tool (probably just requires an option to specify encoding or something like that).
I had that issue too, and fixed it up temporarily to get the tool working, I will have to look into a more permanent solution now.
issue #2:
When you compile the game in release mode it throws this warning a million times (due to the optimizer):
Code: Select all
components/esm/esm_reader.hpp: In member function ‘float ESM::ESMReader::getFVer()’:
components/esm/esm_reader.hpp:156:58: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
which comes from this line:
Code: Select all
float getFVer() { return *((float*)&mCtx.header.version); }
It turns out that we have a struct ESM_Context whose Head sub-member has a integer member named version, which is actually storing a float and we are using this hacky cast to convert it back to float when we request it.
Not sure how to proceed with this one.
There are only two possible values for the version:
Code: Select all
enum Version
{
VER_12 = 0x3f99999a,
VER_13 = 0x3fa66666
};
so one solution would be to convert the function into something like this:
Code: Select all
float getFVer() { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
ideas?