From c93cf822c74dceaddcb3332e814e0d6834a408cf Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 14 Apr 2017 23:21:20 +0400 Subject: [PATCH] Reviewmenu: read name, race, class and birthsign from player stats (fixes bug #2628) --- apps/openmw/mwgui/charactercreation.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index 9464daaf6..b2c9f1038 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -13,6 +13,7 @@ #include "../mwworld/class.hpp" #include "../mwworld/esmstore.hpp" +#include "../mwworld/player.hpp" #include "textinput.hpp" #include "race.hpp" @@ -230,10 +231,19 @@ namespace MWGui MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog); mReviewDialog = 0; mReviewDialog = new ReviewDialog(); - mReviewDialog->setPlayerName(mPlayerName); - mReviewDialog->setRace(mPlayerRaceId); - mReviewDialog->setClass(mPlayerClass); - mReviewDialog->setBirthSign(mPlayerBirthSignId); + + MWBase::World *world = MWBase::Environment::get().getWorld(); + + const ESM::NPC *playerNpc = world->getPlayerPtr().get()->mBase; + + const MWWorld::Player player = world->getPlayer(); + + const ESM::Class *playerClass = world->getStore().get().find(playerNpc->mClass); + + mReviewDialog->setPlayerName(playerNpc->mName); + mReviewDialog->setRace(playerNpc->mRace); + mReviewDialog->setClass(*playerClass); + mReviewDialog->setBirthSign(player.getBirthSign()); { MWWorld::Ptr player = MWMechanics::getPlayer();