mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 22:15:37 +00:00
Merge branch 'more_coverity' into 'master'
More Coverity fixes See merge request OpenMW/openmw!3326
This commit is contained in:
commit
42e7647508
2 changed files with 6 additions and 3 deletions
|
@ -25,7 +25,7 @@ namespace
|
|||
struct AddSpan : AddContent
|
||||
{
|
||||
AddSpan(MWGui::BookTypesetter::Ptr typesetter, MWGui::BookTypesetter::Style* body_style)
|
||||
: AddContent(typesetter, body_style)
|
||||
: AddContent(std::move(typesetter), body_style)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ namespace MWGui
|
|||
typedef TypesetBook::Ptr book;
|
||||
|
||||
JournalBooks::JournalBooks(JournalViewModel::Ptr model, ToUTF8::FromType encoding)
|
||||
: mModel(model)
|
||||
: mModel(std::move(model))
|
||||
, mEncoding(encoding)
|
||||
, mIndexPagesCount(0)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "npcstats.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
|
@ -465,7 +466,8 @@ void MWMechanics::NpcStats::writeState(ESM::NpcStats& state) const
|
|||
{
|
||||
// TODO extend format
|
||||
auto index = ESM::Skill::refIdToIndex(id);
|
||||
value.writeState(state.mSkills[index]);
|
||||
assert(index >= 0);
|
||||
value.writeState(state.mSkills[static_cast<unsigned int>(index)]);
|
||||
}
|
||||
|
||||
state.mIsWerewolf = mIsWerewolf;
|
||||
|
@ -523,6 +525,7 @@ void MWMechanics::NpcStats::readState(const ESM::NpcStats& state)
|
|||
{
|
||||
// TODO extend format
|
||||
ESM::RefId id = ESM::Skill::indexToRefId(i);
|
||||
assert(!id.empty());
|
||||
mSkills[id].readState(state.mSkills[i]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue