| 1910 | } |
| 1911 | |
| 1912 | String Player::getFootstepSound(Vec2I const& sensor) const { |
| 1913 | auto materialDatabase = Root::singleton().materialDatabase(); |
| 1914 | |
| 1915 | String fallback = materialDatabase->defaultFootstepSound(); |
| 1916 | List<Vec2I> scanOrder{{0, 0}, {0, -1}, {-1, 0}, {1, 0}, {-1, -1}, {1, -1}}; |
| 1917 | for (auto subSensor : scanOrder) { |
| 1918 | String footstepSound = materialDatabase->footstepSound(world()->material(sensor + subSensor, TileLayer::Foreground), |
| 1919 | world()->mod(sensor + subSensor, TileLayer::Foreground)); |
| 1920 | if (!footstepSound.empty()) { |
| 1921 | if (footstepSound != fallback) { |
| 1922 | return footstepSound; |
| 1923 | } |
| 1924 | } |
| 1925 | } |
| 1926 | return fallback; |
| 1927 | } |
| 1928 | |
| 1929 | bool Player::inInteractionRange() const { |
| 1930 | return inInteractionRange(centerOfTile(aimPosition())); |
nothing calls this directly
no test coverage detected