lastRainbow = null; $column = (int)floor($x / Round::TILE); for ($row = (int)floor($from / Round::TILE) + 1, $last = (int)floor($to / Round::TILE); $row <= $last; $row++) { if ($this->round->isGround($column, $row)) { $best = $row * Round::TILE; break; } } if ($withRainbows) { foreach ($this->rainbows as $rainbow) { $y = $rainbow->surfaceAt($x); if ($y !== null && $y > ($rainbowFrom ?? $from) && $y <= $to && ($best === null || $y < $best)) { $best = $y; $this->lastRainbow = $rainbow; } } } return $best; } /** A wall at least two tiles high in front of something standing with its feet at $feet. */ public function isWall(float $x, float $feet): bool { $column = (int)floor($x / Round::TILE); $row = (int)floor(($feet - 1) / Round::TILE); return $this->round->isSolid($column, $row) && $this->round->isSolid($column, $row - 1); } }