From 1ecc6f97ed2529ae7c9b22f1fdd85dd829e7f99d Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 4 Jun 2012 20:56:13 +0200 Subject: [PATCH] alchemy effect fix --- apps/openmw/mwgui/widgets.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index c66bf5dd0e..04866b176d 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -54,9 +54,20 @@ namespace MWGui bool operator==(const SpellEffectParams& other) const { - return (other.mEffectID == mEffectID - && other.mSkill == mSkill - && other.mAttribute == mAttribute); + if (mEffectID != other.mEffectID) + return false; + + bool involvesAttribute = (mEffectID == 74 // restore attribute + || mEffectID == 85 // absorb attribute + || mEffectID == 17 // drain attribute + || mEffectID == 79 // fortify attribute + || mEffectID == 22); // damage attribute + bool involvesSkill = (mEffectID == 78 // restore skill + || mEffectID == 89 // absorb skill + || mEffectID == 21 // drain skill + || mEffectID == 83 // fortify skill + || mEffectID == 26); // damage skill + return ((other.mSkill == mSkill) || !involvesSkill) && ((other.mAttribute == mAttribute) && !involvesAttribute); } };