diff --git a/CHANGELOG.md b/CHANGELOG.md index bb6702eec4..e076af98eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,6 +136,7 @@ Bug #6753: Info records without a DATA subrecords are loaded incorrectly Bug #6794: Light sources are attached to mesh bounds centers instead of mesh origins when AttachLight NiNode is missing Bug #6799: Game crashes if an NPC has no Class attached + Bug #6818: ess-importer doesn't exactly reproduce camera Bug #6849: ImageButton texture is not scaled properly Bug #6869: Hits queue stagger during swing animation Bug #6895: Removing a negative number of items from a script, makes the script terminate with an error diff --git a/apps/essimporter/convertplayer.cpp b/apps/essimporter/convertplayer.cpp index b3ccbca358..e80712d6c9 100644 --- a/apps/essimporter/convertplayer.cpp +++ b/apps/essimporter/convertplayer.cpp @@ -1,5 +1,7 @@ #include "convertplayer.hpp" +#include + #include #include @@ -8,6 +10,8 @@ namespace ESSImport void convertPCDT(const PCDT& pcdt, ESM::Player& out, std::vector& outDialogueTopics, bool& firstPersonCam, bool& teleportingEnabled, bool& levitationEnabled, ESM::ControlsState& controls) { + out.mObject.mPosition.rot[0] = -atan2(pcdt.mPNAM.mVerticalRotation.mData[2][1], pcdt.mPNAM.mVerticalRotation.mData[2][2]); + out.mBirthsign = pcdt.mBirthsign; out.mObject.mNpcStats.mBounty = pcdt.mBounty; for (const auto & essFaction : pcdt.mFactions) diff --git a/apps/essimporter/importplayer.hpp b/apps/essimporter/importplayer.hpp index 6c8f211c57..e872cbe81e 100644 --- a/apps/essimporter/importplayer.hpp +++ b/apps/essimporter/importplayer.hpp @@ -78,6 +78,11 @@ struct PCDT int mCellX, mCellY; // grid coordinates; for interior cells this is always (0, 0) }; + struct Rotation + { + float mData[3][3]; + }; + int mPlayerFlags; // controls, camera and draw state unsigned int mLevelProgress; float mSkillProgress[27]; // skill progress, non-uniform scaled @@ -88,7 +93,8 @@ struct PCDT int mDetectEnchantmentMagnitude; // seems redundant int mDetectAnimalMagnitude; // seems redundant MarkLocation mMarkLocation; - unsigned char mUnknown3[40]; + unsigned char mUnknown3[4]; + Rotation mVerticalRotation; unsigned char mSpecIncreases[3]; // number of skill increases for each specialization unsigned char mUnknown4; };