From f818fa1ebfa84a54948b31f9ce4c6de145f036d3 Mon Sep 17 00:00:00 2001 From: greye Date: Thu, 8 Nov 2012 01:39:24 +0400 Subject: [PATCH] minor update since records contains own id --- apps/openmw/mwgui/levelupdialog.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index d8f12bcbb..099132b8b 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -120,19 +120,10 @@ namespace MWGui setAttributeValues(); // set class image - const ESM::Class& playerClass = *MWBase::Environment::get().getWorld ()->getPlayer ().getClass (); - // retrieve the ID to this class - std::string classId; - const MWWorld::Store &classes = - MWBase::Environment::get().getWorld()->getStore().get(); - - MWWorld::Store::iterator it = classes.begin(); - for (; it != classes.end(); ++it) - { - if (playerClass.mName == it->mName) - classId = it->mId; - } - mClassImage->setImageTexture ("textures\\levelup\\" + classId + ".dds"); + const ESM::Class *cls = + MWBase::Environment::get().getWorld ()->getPlayer ().getClass (); + + mClassImage->setImageTexture ("textures\\levelup\\" + cls->mId + ".dds"); /// \todo replace this with INI-imported texts int level = creatureStats.getLevel ()+1;