The other way leaks memory like a sieve.

This commit is contained in:
GJ 2013-05-22 00:01:19 -04:00
parent f21fbe2d40
commit 030c8e59d7

View File

@ -383,8 +383,11 @@ public final class CombatUtils {
int numberOfTargets = Misc.getTier(attacker.getItemInHand()); // The higher the weapon tier, the more targets you hit
int damageAmount = Math.max(damage, 1);
while (numberOfTargets > 0) {
for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
if (numberOfTargets <= 0) {
break;
}
if (Misc.isNPCEntity(entity) || !(entity instanceof LivingEntity) || !shouldBeAffected(attacker, entity)) {
continue;
}
@ -416,7 +419,6 @@ public final class CombatUtils {
numberOfTargets--;
}
}
}
public static void startGainXp(McMMOPlayer mcMMOPlayer, LivingEntity target, SkillType skillType) {
startGainXp(mcMMOPlayer, target, skillType, 1.0);