1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 21:45:32 +00:00

Do not allow mods to change fixed effect properties in the legacy format, but allow it entirely in the new format.

This commit is contained in:
MiroslavR 2014-08-25 18:59:50 +02:00
parent fc21d898f2
commit 46e9ee408f
2 changed files with 13 additions and 7 deletions

View file

@ -42,8 +42,13 @@ void MagicEffect::load(ESMReader &esm)
esm.getHNT(mIndex, "INDX");
esm.getHNT(mData, "MEDT", 36);
if (mIndex>=0 && mIndex<NumberOfHardcodedFlags)
mData.mFlags |= HardcodedFlags[mIndex];
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");

View file

@ -16,7 +16,7 @@ struct MagicEffect
enum Flags
{
// Hardcoded flags
// Originally fixed flags (HardcodedFlags array consists of just these)
TargetSkill = 0x1, // Affects a specific skill, which is specified elsewhere in the effect structure.
TargetAttribute = 0x2, // Affects a specific attribute, which is specified elsewhere in the effect structure.
NoDuration = 0x4, // Has no duration. Only runs effect once on cast.
@ -31,11 +31,12 @@ struct MagicEffect
Unreflectable = 0x10000, // Cannot be reflected, the effect always lands normally.
CasterLinked = 0x20000, // Must quench if caster is dead, or not an NPC/creature. Not allowed in containter/door trap spells.
// Moddable flags
AllowSpellmaking = 0x200,
AllowEnchanting = 0x400,
Negative = 0x800 // TODO: needs research
// Originally modifiable flags
AllowSpellmaking = 0x200, // Can be used for spellmaking
AllowEnchanting = 0x400, // Can be used for enchanting
NegativeLight = 0x800 // Negative light source
};
enum MagnitudeDisplayType
{
MDT_None,