mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
move weather from WorldRenderer to LevelFrontend
This commit is contained in:
parent
22f09d3659
commit
ac00c561ee
7 changed files with 26 additions and 10 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue