Skip to content

Commit

Permalink
[10417] Fix Battle/Guardian elixirs stacking
Browse files Browse the repository at this point in the history
  • Loading branch information
Laise committed Aug 28, 2010
1 parent 21614eb commit bc54ac8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/game/SpellMgr.cpp
Expand Up @@ -305,7 +305,11 @@ bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 spellId_2)
if (spellInfo_1->Effect[i] == spellInfo_2->Effect[j]
&& spellInfo_1->EffectApplyAuraName[i] == spellInfo_2->EffectApplyAuraName[j]
&& spellInfo_1->EffectMiscValue[i] == spellInfo_2->EffectMiscValue[j]
&& spellInfo_1->EffectItemType[i] == spellInfo_2->EffectItemType[j])
&& spellInfo_1->EffectItemType[i] == spellInfo_2->EffectItemType[j]
&& (spellInfo_1->Effect[i] != 0 || spellInfo_1->EffectApplyAuraName[i] != 0 ||
spellInfo_1->EffectMiscValue[i] != 0 || spellInfo_1->EffectItemType[i] != 0)
&& (spellInfo_1->Effect[j] != 0 || spellInfo_1->EffectApplyAuraName[j] != 0 ||
spellInfo_1->EffectMiscValue[j] != 0 || spellInfo_1->EffectItemType[j] != 0))
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10416"
#define REVISION_NR "10417"
#endif // __REVISION_NR_H__

4 comments on commit bc54ac8

@LordJZ
Copy link
Contributor

@LordJZ LordJZ commented on bc54ac8 Aug 28, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see you're back.

@m4cm4n
Copy link

@m4cm4n m4cm4n commented on bc54ac8 Aug 28, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this part:

  •            && (spellInfo_1->Effect[j] != 0 || spellInfo_1->EffectApplyAuraName[j] != 0 || 
    
  •                spellInfo_1->EffectMiscValue[j] != 0 || spellInfo_1->EffectItemType[j] != 0))
    

you are checking effect of spell 1 with counter from spell 2, it's also unnecessary if it was supposed to check for zero values in spell 2 because there is already check if those effects from spell 1 and spell 2 are equal at the beggining (so if spell 1 effect is not zero, then spell 2 effect can't be zero).
I think it's enough to check it the way I posted on forums: http://getmangos.com/community/showthread.php?t=14822

@m4cm4n
Copy link

@m4cm4n m4cm4n commented on bc54ac8 Aug 28, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this part:

  •            && (spellInfo_1->Effect[j] != 0 || spellInfo_1->EffectApplyAuraName[j] != 0 || 
    
  •                spellInfo_1->EffectMiscValue[j] != 0 || spellInfo_1->EffectItemType[j] != 0))
    

you are checking effect from spell 1 with counter from spell 2...
if it was supposed to check effect from spell 2, then it's also unnecessary because there is already check if effects from spell 1 and spell 2 are equal (so if spell 1 effect is not zero, then spell 2 effect can't be zero as well)

it's enough to check it the way I posted in forums: http://getmangos.com/community/showthread.php?t=14822

@Laise
Copy link
Contributor Author

@Laise Laise commented on bc54ac8 Aug 30, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea maybe unnecessary to check second spell..

Please sign in to comment.