mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:29:55 +00:00
Allow subrecords to overlap the following record (bug #6025)
This commit is contained in:
parent
5b9a195e3d
commit
66fd1f8862
2 changed files with 9 additions and 7 deletions
|
@ -17,6 +17,7 @@
|
||||||
Bug #5870: Disposing of actors who were selected in the console doesn't deselect them like vanilla
|
Bug #5870: Disposing of actors who were selected in the console doesn't deselect them like vanilla
|
||||||
Bug #5883: Immobile creatures don't cause water ripples
|
Bug #5883: Immobile creatures don't cause water ripples
|
||||||
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load
|
||||||
|
Bug #6025: Subrecords cannot overlap records
|
||||||
Bug #6027: Collisionshape becomes spiderweb-like when the mesh is too complex
|
Bug #6027: Collisionshape becomes spiderweb-like when the mesh is too complex
|
||||||
Bug #6313: Followers with high Fight can turn hostile
|
Bug #6313: Followers with high Fight can turn hostile
|
||||||
Bug #6427: Enemy health bar disappears before damaging effect ends
|
Bug #6427: Enemy health bar disappears before damaging effect ends
|
||||||
|
|
|
@ -342,10 +342,7 @@ namespace ESM
|
||||||
getUint(mCtx.leftSub);
|
getUint(mCtx.leftSub);
|
||||||
mCtx.leftRec -= sizeof(mCtx.leftSub);
|
mCtx.leftRec -= sizeof(mCtx.leftSub);
|
||||||
|
|
||||||
// Adjust number of record bytes left
|
// Adjust number of record bytes left; may go negative
|
||||||
if (mCtx.leftRec < mCtx.leftSub)
|
|
||||||
fail("Record size is larger than rest of file: " + std::to_string(mCtx.leftRec) + " < "
|
|
||||||
+ std::to_string(mCtx.leftSub));
|
|
||||||
mCtx.leftRec -= mCtx.leftSub;
|
mCtx.leftRec -= mCtx.leftSub;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,6 +350,13 @@ namespace ESM
|
||||||
{
|
{
|
||||||
if (!hasMoreRecs())
|
if (!hasMoreRecs())
|
||||||
fail("No more records, getRecName() failed");
|
fail("No more records, getRecName() failed");
|
||||||
|
if (hasMoreSubs())
|
||||||
|
fail("Previous record contains unread bytes");
|
||||||
|
|
||||||
|
// We went out of the previous record's bounds. Backtrack.
|
||||||
|
if (mCtx.leftRec < 0)
|
||||||
|
mEsm->seekg(mCtx.leftRec, std::ios::cur);
|
||||||
|
|
||||||
getName(mCtx.recName);
|
getName(mCtx.recName);
|
||||||
mCtx.leftFile -= decltype(mCtx.recName)::sCapacity;
|
mCtx.leftFile -= decltype(mCtx.recName)::sCapacity;
|
||||||
|
|
||||||
|
@ -373,11 +377,8 @@ namespace ESM
|
||||||
|
|
||||||
void ESMReader::getRecHeader(uint32_t& flags)
|
void ESMReader::getRecHeader(uint32_t& flags)
|
||||||
{
|
{
|
||||||
// General error checking
|
|
||||||
if (mCtx.leftFile < static_cast<std::streamsize>(3 * sizeof(uint32_t)))
|
if (mCtx.leftFile < static_cast<std::streamsize>(3 * sizeof(uint32_t)))
|
||||||
fail("End of file while reading record header");
|
fail("End of file while reading record header");
|
||||||
if (mCtx.leftRec)
|
|
||||||
fail("Previous record contains unread bytes");
|
|
||||||
|
|
||||||
std::uint32_t leftRec = 0;
|
std::uint32_t leftRec = 0;
|
||||||
getUint(leftRec);
|
getUint(leftRec);
|
||||||
|
|
Loading…
Reference in a new issue