private function getNearestPlayer() { $dis = PHP_INT_MAX; $player = false; foreach ($this->getViewers() as $p) { if ($p->distance($this) < $dis) { $dis = $p->distance($this); $player = $p; } } return $dis <= $this->hate_r ? $p : false; }