mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 19:19:55 +00:00
49d912e5b6
Nice side effects: - Subrecord name comparison now uses magic number instead of string (faster) - Improves the error message for unknown subrecords: will print the record in question instead of failing to read the next record with a strange error
30 lines
544 B
C++
30 lines
544 B
C++
#include "effectlist.hpp"
|
|
|
|
#include "esmreader.hpp"
|
|
#include "esmwriter.hpp"
|
|
|
|
namespace ESM {
|
|
|
|
void EffectList::load(ESMReader &esm)
|
|
{
|
|
mList.clear();
|
|
while (esm.isNextSub("ENAM")) {
|
|
add(esm);
|
|
}
|
|
}
|
|
|
|
void EffectList::add(ESMReader &esm)
|
|
{
|
|
ENAMstruct s;
|
|
esm.getHT(s, 24);
|
|
mList.push_back(s);
|
|
}
|
|
|
|
void EffectList::save(ESMWriter &esm) const
|
|
{
|
|
for (std::vector<ENAMstruct>::const_iterator it = mList.begin(); it != mList.end(); ++it) {
|
|
esm.writeHNT<ENAMstruct>("ENAM", *it, 24);
|
|
}
|
|
}
|
|
|
|
} // end namespace
|