Skip to content

Commit

Permalink
vDistAir: Fix envelope for missing/reset past move data.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Dec 30, 2015
1 parent 6c797f8 commit 65e655a
Showing 1 changed file with 11 additions and 8 deletions.
Expand Up @@ -147,6 +147,11 @@ public Location check(final Player player, final PlayerLocation from, final Play
}
}

// Recover from data removal (somewhat random insertion point).
if (data.liftOffEnvelope == LiftOffEnvelope.UNKNOWN) {
data.adjustMediumProperties(from);
}

// Ensure we have a set-back location set, plus allow moving from upwards with respawn/login.
if (!data.hasSetBack()) {
data.setSetBack(from);
Expand Down Expand Up @@ -919,7 +924,12 @@ else if (lastMove.toIsValid) {
strictVdistRel = true;
}
}
else if (lastMove.valid) {
else {
if (lastMove.valid) {
tags.add("data_reset");
} else {
tags.add("data_missing");
}
// Teleport/join/respawn.
if (data.thisMove.from.onGround) {
vAllowedDistance = maxJumpGain + jumpGainMargin;
Expand All @@ -932,13 +942,6 @@ else if (lastMove.valid) {
}
strictVdistRel = false;
}
else {
// Problematic point (thinking of "ncp remove ...").
// Ensure: data.resetLastDistances() must be used on teleport/join etc.
vAllowedDistance = yDistance;
strictVdistRel = true;
tags.add("data_missing");
}
// Compare yDistance to expected, use velocity on violation.
// TODO: Quick detect valid envelope and move workaround code into a method.
// TODO: data.noFallAssumeGround needs more precise flags (refactor to per move data objects, store 123)
Expand Down

0 comments on commit 65e655a

Please sign in to comment.