|
|
@ -123,7 +123,7 @@ std::string ESMReader::getHString()
|
|
|
|
// Skip the following zero byte
|
|
|
|
// Skip the following zero byte
|
|
|
|
mCtx.leftRec--;
|
|
|
|
mCtx.leftRec--;
|
|
|
|
char c;
|
|
|
|
char c;
|
|
|
|
mEsm->read(&c, 1);
|
|
|
|
getExact(&c, 1);
|
|
|
|
return "";
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -186,7 +186,7 @@ void ESMReader::getSubName()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// reading the subrecord data anyway.
|
|
|
|
// reading the subrecord data anyway.
|
|
|
|
mEsm->read(mCtx.subName.name, 4);
|
|
|
|
getExact(mCtx.subName.name, 4);
|
|
|
|
mCtx.leftRec -= 4;
|
|
|
|
mCtx.leftRec -= 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -194,7 +194,7 @@ bool ESMReader::isEmptyOrGetName()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mCtx.leftRec)
|
|
|
|
if (mCtx.leftRec)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mEsm->read(mCtx.subName.name, 4);
|
|
|
|
getExact(mCtx.subName.name, 4);
|
|
|
|
mCtx.leftRec -= 4;
|
|
|
|
mCtx.leftRec -= 4;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -293,11 +293,18 @@ void ESMReader::getRecHeader(uint32_t &flags)
|
|
|
|
*************************************************************************/
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
void ESMReader::getExact(void*x, int size)
|
|
|
|
void ESMReader::getExact(void*x, int size)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int t = mEsm->read(x, size);
|
|
|
|
int t = mEsm->read(x, size);
|
|
|
|
if (t != size)
|
|
|
|
if (t != size)
|
|
|
|
fail("Read error");
|
|
|
|
fail("Read error");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (std::exception& e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fail(std::string("Read error: ") + e.what());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string ESMReader::getString(int size)
|
|
|
|
std::string ESMReader::getString(int size)
|
|
|
|
{
|
|
|
|
{
|
|
|
|