Minor code cleanup.

This commit is contained in:
MobiusDevelopment
2021-06-12 21:21:17 +00:00
parent dd5bb3f959
commit dcc2fd58f1
51 changed files with 238 additions and 150 deletions

View File

@@ -491,7 +491,7 @@ public class EffectList
{
return hasDances() ? _dances.size() : 0;
}
/**
* Gets the hidden buff count.
* @return the number of hidden buffs

View File

@@ -1861,15 +1861,15 @@ public class Formulas
public static List<BuffInfo> calcStealEffects(Creature target, int amount)
{
final List<BuffInfo> canceled = new ArrayList<>(amount);
// Prevent initialization.
final List<BuffInfo> buffs = target.getEffectList().hasBuffs() ? new ArrayList<>(target.getEffectList().getBuffs()) : new ArrayList<>(1);
if (target.getEffectList().hasDances())
{
buffs.addAll(target.getEffectList().getDances());
}
for (int i = buffs.size() - 1; i >= 0 && canceled.size() < amount; i--) // reverse order
for (int i = buffs.size() - 1; (i >= 0) && (canceled.size() < amount); i--) // reverse order
{
final BuffInfo info = buffs.get(i);
if (!info.getSkill().canBeStolen())
@@ -1880,7 +1880,7 @@ public class Formulas
}
return canceled;
}
public static List<BuffInfo> calcCancelEffects(Creature creature, Creature target, Skill skill, String slot, int rate, int max)
{
final List<BuffInfo> canceled = new ArrayList<>(max);