mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 17:45:35 +00:00
Add assert
This commit is contained in:
parent
e749461d06
commit
1555fd8b34
1 changed files with 3 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "npcstats.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
|
@ -465,6 +466,7 @@ void MWMechanics::NpcStats::writeState(ESM::NpcStats& state) const
|
|||
{
|
||||
// TODO extend format
|
||||
auto index = ESM::Skill::refIdToIndex(id);
|
||||
assert(index >= 0);
|
||||
value.writeState(state.mSkills[static_cast<unsigned int>(index)]);
|
||||
}
|
||||
|
||||
|
@ -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