move weather from WorldRenderer to LevelFrontend

This commit is contained in:
MihailRis 2026-06-19 00:01:45 +03:00
parent 22f09d3659
commit ac00c561ee
7 changed files with 26 additions and 10 deletions

View file

@ -2,6 +2,7 @@
#include "world/Level.hpp"
#include "world/World.hpp"
#include "world/Weather.hpp"
using namespace scripting;
@ -9,6 +10,11 @@ static Weather& require_weather() {
if (level == nullptr) {
throw std::runtime_error("world is not open");
}
if (renderer == nullptr) {
throw std::runtime_error(
"world frontend is not initialized yet (wait for on_hud_open event)"
);
}
return renderer->getWeather();
}