Fixed buff with herb stacking exploit.

This commit is contained in:
MobiusDevelopment
2020-07-20 04:27:33 +00:00
parent 30eb70d951
commit cf38303ace
2 changed files with 24 additions and 46 deletions

View File

@@ -603,8 +603,7 @@ public class EffectList
{ {
_hiddenBuffs.decrementAndGet(); _hiddenBuffs.decrementAndGet();
} }
// Removes the buff from the stack. else // Removes the buff from the stack.
else
{ {
_stackedEffects.remove(info.getSkill().getAbnormalType()); _stackedEffects.remove(info.getSkill().getAbnormalType());
} }
@@ -1425,8 +1424,7 @@ public class EffectList
{ {
stopSkillEffects(false, skill); stopSkillEffects(false, skill);
} }
// Verify stacked skills. else // Verify stacked skills.
else
{ {
synchronized (this) synchronized (this)
{ {
@@ -1436,34 +1434,25 @@ public class EffectList
// Skills are only replaced if the incoming buff has greater or equal abnormal level. // Skills are only replaced if the incoming buff has greater or equal abnormal level.
if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl())) if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl()))
{ {
stopSkillEffects(false, skill.getAbnormalType());
// If it is an herb, set as not in use the lesser buff. // If it is an herb, set as not in use the lesser buff.
// Effect will be present in the effect list. // Effect will be present in the effect list.
// Effects stats are removed and onActionTime() is not called. // Effects stats are removed and onActionTime() is not called.
// But finish task continues to run, and ticks as well. // But finish task continues to run, and ticks as well.
if (skill.isAbnormalInstant())
{
if (stackedInfo.getSkill().isAbnormalInstant()) if (stackedInfo.getSkill().isAbnormalInstant())
{ {
stopSkillEffects(false, skill.getAbnormalType());
stackedInfo = _stackedEffects.get(skill.getAbnormalType()); stackedInfo = _stackedEffects.get(skill.getAbnormalType());
} }
if (stackedInfo != null) if (stackedInfo != null)
{ {
stackedInfo.setInUse(false); stackedInfo.setInUse(false);
// Remove stats
stackedInfo.removeStats(); stackedInfo.removeStats();
_hiddenBuffs.incrementAndGet(); _hiddenBuffs.incrementAndGet();
} }
} }
// Remove buff that will stack with the abnormal type. else // If the new buff is a lesser buff, then don't add it.
else
{
stopSkillEffects(false, skill.getAbnormalType());
}
}
// If the new buff is a lesser buff, then don't add it.
else
{ {
return; return;
} }

View File

@@ -604,8 +604,7 @@ public class EffectList
{ {
_hiddenBuffs.decrementAndGet(); _hiddenBuffs.decrementAndGet();
} }
// Removes the buff from the stack. else // Removes the buff from the stack.
else
{ {
_stackedEffects.remove(info.getSkill().getAbnormalType()); _stackedEffects.remove(info.getSkill().getAbnormalType());
} }
@@ -1426,8 +1425,7 @@ public class EffectList
{ {
stopSkillEffects(false, skill); stopSkillEffects(false, skill);
} }
// Verify stacked skills. else // Verify stacked skills.
else
{ {
synchronized (this) synchronized (this)
{ {
@@ -1437,34 +1435,25 @@ public class EffectList
// Skills are only replaced if the incoming buff has greater or equal abnormal level. // Skills are only replaced if the incoming buff has greater or equal abnormal level.
if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl())) if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl()))
{ {
stopSkillEffects(false, skill.getAbnormalType());
// If it is an herb, set as not in use the lesser buff. // If it is an herb, set as not in use the lesser buff.
// Effect will be present in the effect list. // Effect will be present in the effect list.
// Effects stats are removed and onActionTime() is not called. // Effects stats are removed and onActionTime() is not called.
// But finish task continues to run, and ticks as well. // But finish task continues to run, and ticks as well.
if (skill.isAbnormalInstant())
{
if (stackedInfo.getSkill().isAbnormalInstant()) if (stackedInfo.getSkill().isAbnormalInstant())
{ {
stopSkillEffects(false, skill.getAbnormalType());
stackedInfo = _stackedEffects.get(skill.getAbnormalType()); stackedInfo = _stackedEffects.get(skill.getAbnormalType());
} }
if (stackedInfo != null) if (stackedInfo != null)
{ {
stackedInfo.setInUse(false); stackedInfo.setInUse(false);
// Remove stats
stackedInfo.removeStats(); stackedInfo.removeStats();
_hiddenBuffs.incrementAndGet(); _hiddenBuffs.incrementAndGet();
} }
} }
// Remove buff that will stack with the abnormal type. else // If the new buff is a lesser buff, then don't add it.
else
{
stopSkillEffects(false, skill.getAbnormalType());
}
}
// If the new buff is a lesser buff, then don't add it.
else
{ {
return; return;
} }