Skip to content

Commit

Permalink
Reduce false positives for jumping off water near half-steps.
Browse files Browse the repository at this point in the history
This allows a little more jumping in shallow water.
  • Loading branch information
asofold committed Feb 27, 2013
1 parent eb28f47 commit c8ac66d
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -373,15 +373,22 @@ else if (!data.sfDirty){

// Check lift-off medium.
// TODO: Web might be NO_JUMP !
// TODO: isNextToGround(0.15, 0.4) allows a little much (yMargin), but reduces false positives.
if (to.isInLiquid() || to.isInWeb()){
data.mediumLiftOff = MediumLiftOff.LIMIT_JUMP;
if (to.isInLiquid() && to.isNextToGround(0.15, 0.4)){
// Consent with ground.
data.mediumLiftOff = MediumLiftOff.GROUND;
}
else{
data.mediumLiftOff = MediumLiftOff.LIMIT_JUMP;
}
}
else if (resetTo){
// TODO: This might allow jumping on vines etc., but should do for the moment.
data.mediumLiftOff = MediumLiftOff.GROUND;
}
else if (from.isInLiquid()){
if (to.isNextToGround(0.15, 0.001)){
if (to.isNextToGround(0.15, 0.4)){
data.mediumLiftOff = MediumLiftOff.GROUND;
}
else{
Expand Down

0 comments on commit c8ac66d

Please sign in to comment.