From 694ce537b6dc16f07497f3d3c323337907532401 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 29 Sep 2016 11:02:57 +0300 Subject: [PATCH] Allow script-induced dynamic stat changes, part 2 --- apps/openmw/mwmp/LocalPlayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index db5cc227d..d556949b0 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -239,12 +239,13 @@ void LocalPlayer::setDynamicStats() MWWorld::Ptr player = world->getPlayerPtr(); MWMechanics::CreatureStats *ptrCreatureStats = &player.getClass().getCreatureStats(player); - MWMechanics::DynamicStat dynamicStat; for (int i = 0; i < 3; ++i) { - dynamicStat.readState(CreatureStats()->mDynamic[i]); + dynamicStat = ptrCreatureStats->getDynamic(i); + dynamicStat.setBase(CreatureStats()->mDynamic[i].mBase); + dynamicStat.setCurrent(CreatureStats()->mDynamic[i].mCurrent); ptrCreatureStats->setDynamic(i, dynamicStat); } }