| 2139 | } |
| 2140 | |
| 2141 | bool WorldClient::exposedToWeather(Vec2F const& pos) const { |
| 2142 | if (!inWorld()) |
| 2143 | return false; |
| 2144 | |
| 2145 | if (!isUnderground(pos) && liquidLevel(Vec2I::floor(pos)).liquid == EmptyLiquidId) { |
| 2146 | auto assets = Root::singleton().assets(); |
| 2147 | float weatherRayCheckDistance = assets->json("/weather.config:weatherRayCheckDistance").toFloat(); |
| 2148 | float weatherRayCheckWindInfluence = assets->json("/weather.config:weatherRayCheckWindInfluence").toFloat(); |
| 2149 | |
| 2150 | auto offset = Vec2F(-m_weather.wind() * weatherRayCheckWindInfluence, weatherRayCheckDistance).normalized() * weatherRayCheckDistance; |
| 2151 | |
| 2152 | return !lineCollision({pos, pos + offset}); |
| 2153 | } |
| 2154 | |
| 2155 | return false; |
| 2156 | } |
| 2157 | |
| 2158 | bool WorldClient::isUnderground(Vec2F const& pos) const { |
| 2159 | if (!inWorld()) |
nothing calls this directly
no test coverage detected