forked from teamnwah/openmw-tes3coop
Merge remote-tracking branch 'miroslavr/master'
This commit is contained in:
commit
2a48c377a8
3 changed files with 11 additions and 8 deletions
|
@ -288,7 +288,7 @@ namespace MWMechanics
|
|||
}
|
||||
|
||||
MechanicsManager::MechanicsManager()
|
||||
: mUpdatePlayer (true), mClassSelected (false),
|
||||
: mWatchedStatsEmpty (true), mUpdatePlayer (true), mClassSelected (false),
|
||||
mRaceSelected (false), mAI(true)
|
||||
{
|
||||
//buildPlayer no longer here, needs to be done explicitely after all subsystems are up and running
|
||||
|
@ -350,7 +350,7 @@ namespace MWMechanics
|
|||
const MWMechanics::NpcStats &stats = mWatched.getClass().getNpcStats(mWatched);
|
||||
for(int i = 0;i < ESM::Attribute::Length;++i)
|
||||
{
|
||||
if(stats.getAttribute(i) != mWatchedStats.getAttribute(i))
|
||||
if(stats.getAttribute(i) != mWatchedStats.getAttribute(i) || mWatchedStatsEmpty)
|
||||
{
|
||||
std::stringstream attrname;
|
||||
attrname << "AttribVal"<<(i+1);
|
||||
|
@ -360,19 +360,19 @@ namespace MWMechanics
|
|||
}
|
||||
}
|
||||
|
||||
if(stats.getHealth() != mWatchedStats.getHealth())
|
||||
if(stats.getHealth() != mWatchedStats.getHealth() || mWatchedStatsEmpty)
|
||||
{
|
||||
static const std::string hbar("HBar");
|
||||
mWatchedStats.setHealth(stats.getHealth());
|
||||
winMgr->setValue(hbar, stats.getHealth());
|
||||
}
|
||||
if(stats.getMagicka() != mWatchedStats.getMagicka())
|
||||
if(stats.getMagicka() != mWatchedStats.getMagicka() || mWatchedStatsEmpty)
|
||||
{
|
||||
static const std::string mbar("MBar");
|
||||
mWatchedStats.setMagicka(stats.getMagicka());
|
||||
winMgr->setValue(mbar, stats.getMagicka());
|
||||
}
|
||||
if(stats.getFatigue() != mWatchedStats.getFatigue())
|
||||
if(stats.getFatigue() != mWatchedStats.getFatigue() || mWatchedStatsEmpty)
|
||||
{
|
||||
static const std::string fbar("FBar");
|
||||
mWatchedStats.setFatigue(stats.getFatigue());
|
||||
|
@ -398,7 +398,7 @@ namespace MWMechanics
|
|||
//Loop over ESM::Skill::SkillEnum
|
||||
for(int i = 0; i < ESM::Skill::Length; ++i)
|
||||
{
|
||||
if(stats.getSkill(i) != mWatchedStats.getSkill(i))
|
||||
if(stats.getSkill(i) != mWatchedStats.getSkill(i) || mWatchedStatsEmpty)
|
||||
{
|
||||
update = true;
|
||||
mWatchedStats.getSkill(i) = stats.getSkill(i);
|
||||
|
@ -411,6 +411,8 @@ namespace MWMechanics
|
|||
|
||||
winMgr->setValue("level", stats.getLevel());
|
||||
|
||||
mWatchedStatsEmpty = false;
|
||||
|
||||
// Update the equipped weapon icon
|
||||
MWWorld::InventoryStore& inv = mWatched.getClass().getInventoryStore(mWatched);
|
||||
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace MWMechanics
|
|||
{
|
||||
MWWorld::Ptr mWatched;
|
||||
NpcStats mWatchedStats;
|
||||
bool mWatchedStatsEmpty;
|
||||
bool mUpdatePlayer;
|
||||
bool mClassSelected;
|
||||
bool mRaceSelected;
|
||||
|
|
|
@ -159,7 +159,7 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
|
|||
|
||||
profile.mContentFiles = world.getContentFiles();
|
||||
|
||||
profile.mPlayerName = player.getClass().getName (player);
|
||||
profile.mPlayerName = player.get<ESM::NPC>()->mBase->mName;
|
||||
profile.mPlayerLevel = player.getClass().getNpcStats (player).getLevel();
|
||||
|
||||
std::string classId = player.get<ESM::NPC>()->mBase->mClass;
|
||||
|
@ -438,7 +438,7 @@ void MWState::StateManager::deleteGame(const MWState::Character *character, cons
|
|||
MWState::Character *MWState::StateManager::getCurrentCharacter (bool create)
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||
std::string name = player.getClass().getName(player);
|
||||
std::string name = player.get<ESM::NPC>()->mBase->mName;
|
||||
|
||||
return mCharacterManager.getCurrentCharacter (create, name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue