mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo esm typo
This commit is contained in:
parent
c263bbf0f6
commit
d1fb854521
448 changed files with 686 additions and 683 deletions
73
components/esm3/projectilestate.cpp
Normal file
73
components/esm3/projectilestate.cpp
Normal file
|
@ -0,0 +1,73 @@
|
|||
#include "projectilestate.hpp"
|
||||
|
||||
#include "esmwriter.hpp"
|
||||
#include "esmreader.hpp"
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
|
||||
void BaseProjectileState::save(ESMWriter &esm) const
|
||||
{
|
||||
esm.writeHNString ("ID__", mId);
|
||||
esm.writeHNT ("VEC3", mPosition);
|
||||
esm.writeHNT ("QUAT", mOrientation);
|
||||
esm.writeHNT ("ACTO", mActorId);
|
||||
}
|
||||
|
||||
void BaseProjectileState::load(ESMReader &esm)
|
||||
{
|
||||
mId = esm.getHNString("ID__");
|
||||
esm.getHNT (mPosition, "VEC3");
|
||||
esm.getHNT (mOrientation, "QUAT");
|
||||
esm.getHNT (mActorId, "ACTO");
|
||||
}
|
||||
|
||||
void MagicBoltState::save(ESMWriter &esm) const
|
||||
{
|
||||
BaseProjectileState::save(esm);
|
||||
|
||||
esm.writeHNString ("SPEL", mSpellId);
|
||||
esm.writeHNT ("SPED", mSpeed);
|
||||
esm.writeHNT ("SLOT", mSlot);
|
||||
}
|
||||
|
||||
void MagicBoltState::load(ESMReader &esm)
|
||||
{
|
||||
BaseProjectileState::load(esm);
|
||||
|
||||
mSpellId = esm.getHNString("SPEL");
|
||||
if (esm.isNextSub("SRCN")) // for backwards compatibility
|
||||
esm.skipHSub();
|
||||
ESM::EffectList().load(esm); // for backwards compatibility
|
||||
esm.getHNT (mSpeed, "SPED");
|
||||
if(esm.getFormat() < 17)
|
||||
mSlot = 0;
|
||||
else
|
||||
esm.getHNT(mSlot, "SLOT");
|
||||
if (esm.isNextSub("STCK")) // for backwards compatibility
|
||||
esm.skipHSub();
|
||||
if (esm.isNextSub("SOUN")) // for backwards compatibility
|
||||
esm.skipHSub();
|
||||
}
|
||||
|
||||
void ProjectileState::save(ESMWriter &esm) const
|
||||
{
|
||||
BaseProjectileState::save(esm);
|
||||
|
||||
esm.writeHNString ("BOW_", mBowId);
|
||||
esm.writeHNT ("VEL_", mVelocity);
|
||||
esm.writeHNT ("STR_", mAttackStrength);
|
||||
}
|
||||
|
||||
void ProjectileState::load(ESMReader &esm)
|
||||
{
|
||||
BaseProjectileState::load(esm);
|
||||
|
||||
mBowId = esm.getHNString ("BOW_");
|
||||
esm.getHNT (mVelocity, "VEL_");
|
||||
|
||||
mAttackStrength = 1.f;
|
||||
esm.getHNOT(mAttackStrength, "STR_");
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue