Skip to content

Commit

Permalink
"lost sprint": Remove checking vs horizontal buffer.
Browse files Browse the repository at this point in the history
Might consider for future:
The problems of the type lost-sprint, bunny seem to be client mechanics.
The ground-modifiers apply and stay valid during jump, thus turning off 
sprint for attacking makes sense.

So i revert the statement about "could be worth a ticket" for the
moment. However with looking forward to have a Minecraft API, it could 
could be appropriate to provide something to allow server-side checking,
yet again finding the right ground modifier needs knowledge of the 
exact moves the client did, so client side could change to send all the 
transition events as suggested before.
  • Loading branch information
asofold committed Jul 23, 2013
1 parent b2694d9 commit a872cc8
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -27,7 +27,6 @@
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
import fr.neatmonster.nocheatplus.checks.moving.MovingListener;
import fr.neatmonster.nocheatplus.checks.moving.SurvivalFly;
import fr.neatmonster.nocheatplus.compat.BridgeHealth;
import fr.neatmonster.nocheatplus.components.JoinLeaveListener;
import fr.neatmonster.nocheatplus.permissions.Permissions;
Expand Down Expand Up @@ -229,11 +228,12 @@ else if (normalizedMove > 2.0 && Improbable.check(player, 1f, now, "fight.speed"
// TODO: Reduce distance by width of other entity [make an auxiliary method, use same value for reach].
// TODO: For pvp: make use of "player was there" heuristic later on.
final MovingData mData = MovingData.getData(player);
if (mData.fromX != Double.MAX_VALUE && mData.sfHorizontalBuffer > 0.5 * SurvivalFly.hBufMax && mData.mediumLiftOff != MediumLiftOff.LIMIT_JUMP){
if (mData.fromX != Double.MAX_VALUE && mData.mediumLiftOff != MediumLiftOff.LIMIT_JUMP){
// TODO: What would mData.lostSprintCount > 0 mean here?
// TODO: Confine further.
final double hDist = TrigUtil.distance(loc.getX(), loc.getZ(), mData.fromX, mData.fromZ);
if (hDist >= 0.23) {
// TODO: Might remove checking sfHorizontalBuffer.
// TODO: Might need to check hDist relative to speed / modifiers.
final MovingConfig mc = MovingConfig.getConfig(player);
// Check if fly checks is an issue at all, re-check "real sprinting".
if (now <= mData.timeSprinting + mc.sprintingGrace && MovingListener.shouldCheckSurvivalFly(player, mData, mc)){
Expand Down

0 comments on commit a872cc8

Please sign in to comment.