Fix for issue #6 - projectile launch bug

This commit is contained in:
H31IX committed 2012-07-09 00:51:05 -04:00
1 parent 31be5a1b8e
commit 79a88c9de2
3 files changed
+1 -24

No files matched your search

@@ -18,7 +18,6 @@
package net.h31ix.anticheat.event; package net.h31ix.anticheat.event;
import net.h31ix.anticheat.manage.CheckType;
import java.util.EnumMap; import java.util.EnumMap;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@@ -69,21 +69,12 @@ public class PlayerListener extends EventListener
if (event.getEntity() instanceof Arrow) if (event.getEntity() instanceof Arrow)
{ {
// TF2 Heavy does not approve of this action. He yells "NO!"
return; return;
} }
if (checkManager.willCheck(player, CheckType.FAST_PROJECTILE)) if (checkManager.willCheck(player, CheckType.FAST_PROJECTILE))
{ {
if (backend.justLaunched(player)) backend.logProjectile(player, this);
{
event.setCancelled(!config.silentMode());
log("tried to fire projectiles too fast", player, CheckType.FAST_PROJECTILE);
}
else
{
backend.logProjectile(player, this);
}
} }
} }
} }
@@ -22,8 +22,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.h31ix.anticheat.Anticheat;
import net.h31ix.anticheat.event.EventListener; import net.h31ix.anticheat.event.EventListener;
import net.h31ix.anticheat.util.Distance; import net.h31ix.anticheat.util.Distance;
import net.h31ix.anticheat.util.Utilities; import net.h31ix.anticheat.util.Utilities;
@@ -1023,17 +1021,6 @@ public class Backend
return animated.containsKey(player.getName()); return animated.containsKey(player.getName());
} }
public boolean justLaunched(Player player)
{
if (projectileHold.contains(player.getName()))
{
increment(player, projectilesShot, PROJECTILE_MAX);
return true;
}
return false;
}
public void logProjectile(final Player player, final EventListener e) public void logProjectile(final Player player, final EventListener e)
{ {
if (projectileHold.contains(player.getName())) if (projectileHold.contains(player.getName()))