1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

resetFallDistance() Called Twice When a Player Collides With Water

Discussion in 'Development' started by Smarticles101, Apr 15, 2017.

  1. Smarticles101

    Smarticles101 Silverfish

    Messages:
    22
    GitHub:
    Smarticles101
    I was trying to investigate the bug that causes you to take damage when falling into one-block-deep water, and I came across the following in pocketmine\block\Water
    Code:
    public function onEntityCollide(Entity $entity){
        $entity->resetFallDistance();
        if($entity->fireTicks > 0){
            $entity->extinguish();
        }
        $entity->resetFallDistance();
    }
    
    Why is it that $entity->resetFallDistance() is called twice?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.