mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 03:15:32 +00:00
improved magic effect IDs
This commit is contained in:
parent
23fd314294
commit
850dbb55a5
2 changed files with 29 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "loadmgef.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
|
@ -192,8 +193,7 @@ void MagicEffect::load(ESMReader &esm)
|
|||
{
|
||||
esm.getHNT(mIndex, "INDX");
|
||||
|
||||
if (mIndex>=0 && mIndex<Length)
|
||||
mId = sIds[mIndex];
|
||||
mId = indexToId (mIndex);
|
||||
|
||||
esm.getHNT(mData, "MEDT", 36);
|
||||
if (esm.getFormat() == 0)
|
||||
|
@ -564,4 +564,29 @@ MagicEffect::MagnitudeDisplayType MagicEffect::getMagnitudeDisplayType() const {
|
|||
mAreaSound.clear();
|
||||
mDescription.clear();
|
||||
}
|
||||
|
||||
std::string MagicEffect::indexToId (int index)
|
||||
{
|
||||
std::ostringstream stream;
|
||||
|
||||
if (index!=-1)
|
||||
{
|
||||
stream << "#";
|
||||
|
||||
if (index<100)
|
||||
{
|
||||
stream << "0";
|
||||
|
||||
if (index<10)
|
||||
stream << "0";
|
||||
}
|
||||
|
||||
stream << index;
|
||||
|
||||
if (index>=0 && index<Length)
|
||||
stream << sIds[index];
|
||||
}
|
||||
|
||||
return stream.str();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,6 +252,8 @@ struct MagicEffect
|
|||
|
||||
Length
|
||||
};
|
||||
|
||||
static std::string indexToId (int index);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue