Fully reset the player's cell reference when the player is reset (#8021)

pull/3236/head
Alexei Kotov 7 months ago
parent 218e19d8f7
commit 39a231233c

@ -181,6 +181,7 @@
Bug #7997: Can toggle perspective when paralyzed
Bug #8002: Portable light sources held by creatures do not emit lighting
Bug #8018: Potion effects should never explode and always apply on self
Bug #8021: Player's scale doesn't reset when starting a new game
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3537: Shader-based water ripples

@ -242,6 +242,11 @@ namespace MWWorld
void Player::clear()
{
ESM::CellRef cellRef;
cellRef.blank();
cellRef.mRefID = ESM::RefId::stringRefId("Player");
cellRef.mRefNum = mPlayer.mRef.getRefNum();
mPlayer = LiveCellRef<ESM::NPC>(cellRef, mPlayer.mBase);
mCellStore = nullptr;
mSign = ESM::RefId();
mMarkedCell = nullptr;

@ -426,8 +426,6 @@ namespace MWWorld
if (mPlayer)
{
mPlayer->clear();
mPlayer->setCell(nullptr);
mPlayer->getPlayer().getRefData() = RefData();
mPlayer->set(mStore.get<ESM::NPC>().find(ESM::RefId::stringRefId("Player")));
}

Loading…
Cancel
Save