From 8ccb0907e647dc02f770aaf5357927605dac811f Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 12 Oct 2012 14:26:10 +0200 Subject: [PATCH] assertion -> exception; added the old effect flags again --- components/esm/loadmgef.cpp | 5 ++++- components/esm/loadmgef.hpp | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp index 954214036..d0230e3b6 100644 --- a/components/esm/loadmgef.cpp +++ b/components/esm/loadmgef.cpp @@ -1,5 +1,7 @@ #include "loadmgef.hpp" +#include + #include "esmreader.hpp" #include "esmwriter.hpp" @@ -231,7 +233,8 @@ std::string MagicEffect::effectIdToString(short effectID) // tribunal names[137] ="sEffectSummonFabricant"; - assert(names.find(effectID) != names.end() && "Unimplemented effect type"); + if (names.find(effectID) == names.end()) + throw std::runtime_error( std::string("Unimplemented effect ID ") + boost::lexical_cast(effectID)); return names[effectID]; } diff --git a/components/esm/loadmgef.hpp b/components/esm/loadmgef.hpp index abf4ab545..00349a355 100644 --- a/components/esm/loadmgef.hpp +++ b/components/esm/loadmgef.hpp @@ -17,7 +17,7 @@ struct MagicEffect 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. NoMagnitude = 0x8, // Has no magnitude. - Negative = 0x10, // Counts as a negative effect. Interpreted as useful for attack, and is treated as a bad effect in alchemy. + Harmful = 0x10, // Counts as a negative effect. Interpreted as useful for attack, and is treated as a bad effect in alchemy. ContinuousVfx = 0x20, // The effect's hit particle VFX repeats for the full duration of the spell, rather than occuring once on hit. CastSelf = 0x40, // Allows range - cast on self. CastTouch = 0x80, // Allows range - cast on touch. @@ -25,7 +25,12 @@ struct MagicEffect UncappedDamage = 0x1000, // Negates multiple cap behaviours. Allows an effect to reduce an attribute below zero; removes the normal minimum effect duration of 1 second. NonRecastable = 0x4000, // Does not land if parent spell is already affecting target. Shows "you cannot re-cast" message for self target. 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. + CasterLinked = 0x20000, // Must quench if caster is dead, or not an NPC/creature. Not allowed in containter/door trap spells. + + SpellMaking = 0x0200, + Enchanting = 0x0400, + Negative = 0x0800 // A harmful effect. Will determine whether + // eg. NPCs regard this spell as an attack. (same as 0x10?) }; struct MEDTstruct