mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Merge pull request #1177 from MiroslavR/essimporter-enam
ESSImporter: Convert last known exterior cell
This commit is contained in:
commit
761472f6f1
@ -75,6 +75,14 @@ namespace ESSImport
|
|||||||
out.mMarkedPosition.rot[0] = out.mMarkedPosition.rot[1] = 0.0f;
|
out.mMarkedPosition.rot[0] = out.mMarkedPosition.rot[1] = 0.0f;
|
||||||
out.mMarkedPosition.rot[2] = mark.mRotZ;
|
out.mMarkedPosition.rot[2] = mark.mRotZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pcdt.mHasENAM)
|
||||||
|
{
|
||||||
|
const int cellSize = 8192;
|
||||||
|
out.mLastKnownExteriorPosition[0] = (pcdt.mENAM.mCellX + 0.5f) * cellSize;
|
||||||
|
out.mLastKnownExteriorPosition[1] = (pcdt.mENAM.mCellY + 0.5f) * cellSize;
|
||||||
|
out.mLastKnownExteriorPosition[2] = 0.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,10 @@ namespace ESSImport
|
|||||||
playerCellId.mPaged = true;
|
playerCellId.mPaged = true;
|
||||||
playerCellId.mIndex.mX = playerCellId.mIndex.mY = 0;
|
playerCellId.mIndex.mX = playerCellId.mIndex.mY = 0;
|
||||||
mPlayer.mCellId = playerCellId;
|
mPlayer.mCellId = playerCellId;
|
||||||
//mPlayer.mLastKnownExteriorPosition
|
mPlayer.mLastKnownExteriorPosition[0]
|
||||||
|
= mPlayer.mLastKnownExteriorPosition[1]
|
||||||
|
= mPlayer.mLastKnownExteriorPosition[2]
|
||||||
|
= 0.0f;
|
||||||
mPlayer.mHasMark = 0;
|
mPlayer.mHasMark = 0;
|
||||||
mPlayer.mCurrentCrimeId = 0; // TODO
|
mPlayer.mCurrentCrimeId = 0; // TODO
|
||||||
mPlayer.mObject.blank();
|
mPlayer.mObject.blank();
|
||||||
|
@ -37,6 +37,14 @@ namespace ESSImport
|
|||||||
if (esm.isNextSub("NAM9"))
|
if (esm.isNextSub("NAM9"))
|
||||||
esm.skipHSub();
|
esm.skipHSub();
|
||||||
|
|
||||||
|
// Rest state. You shouldn't even be able to save during rest, but skip just in case.
|
||||||
|
if (esm.isNextSub("RNAM"))
|
||||||
|
/*
|
||||||
|
int hoursLeft;
|
||||||
|
float x, y, z; // resting position
|
||||||
|
*/
|
||||||
|
esm.skipHSub(); // 16 bytes
|
||||||
|
|
||||||
mBounty = 0;
|
mBounty = 0;
|
||||||
esm.getHNOT(mBounty, "CNAM");
|
esm.getHNOT(mBounty, "CNAM");
|
||||||
|
|
||||||
@ -70,12 +78,19 @@ namespace ESSImport
|
|||||||
mFactions.push_back(fnam);
|
mFactions.push_back(fnam);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (esm.isNextSub("AADT"))
|
mHasAADT = false;
|
||||||
esm.skipHSub(); // 44 bytes, no clue
|
if (esm.isNextSub("AADT")) // Attack animation data?
|
||||||
|
{
|
||||||
|
mHasAADT = true;
|
||||||
|
esm.getHT(mAADT);
|
||||||
|
}
|
||||||
|
|
||||||
if (esm.isNextSub("KNAM"))
|
if (esm.isNextSub("KNAM"))
|
||||||
esm.skipHSub(); // assigned Quick Keys, I think
|
esm.skipHSub(); // assigned Quick Keys, I think
|
||||||
|
|
||||||
|
if (esm.isNextSub("ANIS"))
|
||||||
|
esm.skipHSub(); // 16 bytes
|
||||||
|
|
||||||
if (esm.isNextSub("WERE"))
|
if (esm.isNextSub("WERE"))
|
||||||
{
|
{
|
||||||
// some werewolf data, 152 bytes
|
// some werewolf data, 152 bytes
|
||||||
@ -83,10 +98,6 @@ namespace ESSImport
|
|||||||
esm.getSubHeader();
|
esm.getSubHeader();
|
||||||
esm.skip(152);
|
esm.skip(152);
|
||||||
}
|
}
|
||||||
|
|
||||||
// unsure if before or after WERE
|
|
||||||
if (esm.isNextSub("ANIS"))
|
|
||||||
esm.skipHSub();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,12 @@ struct PCDT
|
|||||||
int mCellX;
|
int mCellX;
|
||||||
int mCellY;
|
int mCellY;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct AADT // 44 bytes
|
||||||
|
{
|
||||||
|
int animGroupIndex; // See convertANIS() for the mapping.
|
||||||
|
unsigned char mUnknown5[40];
|
||||||
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
std::vector<FNAM> mFactions;
|
std::vector<FNAM> mFactions;
|
||||||
@ -109,6 +115,9 @@ struct PCDT
|
|||||||
bool mHasENAM;
|
bool mHasENAM;
|
||||||
ENAM mENAM; // last exterior cell
|
ENAM mENAM; // last exterior cell
|
||||||
|
|
||||||
|
bool mHasAADT;
|
||||||
|
AADT mAADT;
|
||||||
|
|
||||||
void load(ESM::ESMReader& esm);
|
void load(ESM::ESMReader& esm);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user