| 2246 | } |
| 2247 | |
| 2248 | bool WorldServer::exposedToWeather(Vec2F const& pos) const { |
| 2249 | if (!isUnderground(pos) && liquidLevel(Vec2I::floor(pos)).liquid == EmptyLiquidId) { |
| 2250 | auto assets = Root::singleton().assets(); |
| 2251 | float weatherRayCheckDistance = assets->json("/weather.config:weatherRayCheckDistance").toFloat(); |
| 2252 | float weatherRayCheckWindInfluence = assets->json("/weather.config:weatherRayCheckWindInfluence").toFloat(); |
| 2253 | |
| 2254 | auto offset = Vec2F(-m_weather.wind() * weatherRayCheckWindInfluence, weatherRayCheckDistance).normalized() * weatherRayCheckDistance; |
| 2255 | |
| 2256 | return !lineCollision({pos, pos + offset}); |
| 2257 | } |
| 2258 | |
| 2259 | return false; |
| 2260 | } |
| 2261 | |
| 2262 | bool WorldServer::isUnderground(Vec2F const& pos) const { |
| 2263 | return m_worldTemplate->undergroundLevel() >= pos[1]; |
nothing calls this directly
no test coverage detected