Skip to content

Commit

Permalink
Fully reset the player's cell reference when the player is reset (#8021)
Browse files Browse the repository at this point in the history
  • Loading branch information
Capostrophic committed Jun 15, 2024
1 parent 218e19d commit 39a2312
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions apps/openmw/mwworld/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions apps/openmw/mwworld/worldimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}

Expand Down

0 comments on commit 39a2312

Please sign in to comment.