1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

Editor: Warn if a magic effect's max magnitude is zero

This commit is contained in:
Alexei Kotov 2024-06-07 12:32:59 +03:00
parent 2fdbd6287d
commit ba20ba2c6c
3 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,9 @@ void CSMTools::EnchantmentCheckStage::perform(int stage, CSMDoc::Messages& messa
if (effect->mData.mMagnMax < 0)
messages.add(
id, "Effect #" + number + " maximum magnitude is negative", "", CSMDoc::Message::Severity_Error);
else if (effect->mData.mMagnMax == 0)
messages.add(
id, "Effect #" + number + " maximum magnitude is zero", "", CSMDoc::Message::Severity_Warning);
if (effect->mData.mMagnMin > effect->mData.mMagnMax)
messages.add(id, "Effect #" + number + " minimum magnitude is higher than maximum magnitude", "",
CSMDoc::Message::Severity_Error);

View File

@ -363,6 +363,9 @@ void CSMTools::ReferenceableCheckStage::potionCheck(
if (effect->mData.mMagnMax < 0)
messages.add(
id, "Effect #" + number + " maximum magnitude is negative", "", CSMDoc::Message::Severity_Error);
else if (effect->mData.mMagnMax == 0)
messages.add(
id, "Effect #" + number + " maximum magnitude is zero", "", CSMDoc::Message::Severity_Warning);
if (effect->mData.mMagnMin > effect->mData.mMagnMax)
messages.add(id, "Effect #" + number + " minimum magnitude is higher than maximum magnitude", "",
CSMDoc::Message::Severity_Error);

View File

@ -79,6 +79,9 @@ void CSMTools::SpellCheckStage::perform(int stage, CSMDoc::Messages& messages)
if (effect->mData.mMagnMax < 0)
messages.add(
id, "Effect #" + number + " maximum magnitude is negative", "", CSMDoc::Message::Severity_Error);
else if (effect->mData.mMagnMax == 0)
messages.add(
id, "Effect #" + number + " maximum magnitude is zero", "", CSMDoc::Message::Severity_Warning);
if (effect->mData.mMagnMin > effect->mData.mMagnMax)
messages.add(id, "Effect #" + number + " minimum magnitude is higher than maximum magnitude", "",
CSMDoc::Message::Severity_Error);