Example #1
0
void ESM::ObjectState::load (ESMReader &esm)
{
    mVersion = esm.getFormat();

    bool isDeleted;
    mRef.loadData(esm, isDeleted);

    mHasLocals = 0;
    esm.getHNOT (mHasLocals, "HLOC");

    if (mHasLocals)
        mLocals.load (esm);

    mEnabled = 1;
    esm.getHNOT (mEnabled, "ENAB");

    mCount = 1;
    esm.getHNOT (mCount, "COUN");

    esm.getHNOT (mPosition, "POS_", 24);

    if (esm.isNextSub("LROT"))
        esm.skipHSub(); // local rotation, no longer used

    // obsolete
    int unused;
    esm.getHNOT(unused, "LTIM");

    // FIXME: assuming "false" as default would make more sense, but also break compatibility with older save files
    mHasCustomState = true;
    esm.getHNOT (mHasCustomState, "HCUS");
}
Example #2
0
void MagicEffect::load(ESMReader &esm)
{
  esm.getHNT(mIndex, "INDX");

  esm.getHNT(mData, "MEDT", 36);
  if (esm.getFormat() == 0)
  {
      // don't allow mods to change fixed flags in the legacy format
      mData.mFlags &= (AllowSpellmaking | AllowEnchanting | NegativeLight);
      if (mIndex>=0 && mIndex<NumberOfHardcodedFlags)
        mData.mFlags |= HardcodedFlags[mIndex];
  }

  mIcon = esm.getHNOString("ITEX");
  mParticle = esm.getHNOString("PTEX");

  mBoltSound = esm.getHNOString("BSND");
  mCastSound = esm.getHNOString("CSND");
  mHitSound = esm.getHNOString("HSND");
  mAreaSound = esm.getHNOString("ASND");

  mCasting = esm.getHNOString("CVFX");
  mBolt = esm.getHNOString("BVFX");
  mHit = esm.getHNOString("HVFX");
  mArea = esm.getHNOString("AVFX");

  mDescription = esm.getHNOString("DESC");
}